17 Star 58 Fork 24

Talkweb_OpenHarmony / Niobe

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
安装docker.md 2.45 KB
一键复制 编辑 原始数据 按行查看 历史
候鹏飞 提交于 2021-09-26 08:49 . update

安装Docker及编译源码

参考docker官方教程

该教程适合以下几个系统

  • Ubuntu Hirsute 21.04
  • Ubuntu Groovy 20.10
  • Ubuntu Focal 20.04 (LTS)
  • Ubuntu Bionic 18.04 (LTS)
  • Ubuntu Xenial 16.04 (LTS)
  1. 卸载Docker老版本
sudo apt-get remove docker docker-engine docker.io containerd runc
  1. 更新apt软件包索引并安装软件包以允许apt通过HTTPS使用存储库
sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
  1. 添加Docker的官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
  1. 添加仓库
echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
  1. 安装docker
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
  1. 运行测试docker
sudo docker run hello-world
  • 运行成功结果如下:
Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/
  1. 根据OpenHarmony官方指导进行鸿蒙Docker镜像构建
  • 获取Docker镜像
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
  • 进入OpenHarmony代码根目录执行如下命令,从而进入Docker构建环境
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.5
1
https://gitee.com/talkweb_oh/niobe.git
git@gitee.com:talkweb_oh/niobe.git
talkweb_oh
niobe
Niobe
master

搜索帮助