1、安装Docker
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo systemctl enable docker
# add user to docker right
sudo gpasswd -a ${USER} docker
sudo chown ${USER}:${USER} /var/run/docker.sock
sudo systemctl restart docker
2、安装Docker??Compose
运行以下命令下载 Docker Compose 的当前稳定版本:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
对二进制文件应用可执行权限:
sudo chmod +x /usr/local/bin/docker-compose
通过查看Docker Compose的版本验证是否成功安装:
docker-compose --version
3、增加docker 中国镜像
使用原来的镜像源可能速度比较慢,建议使用国内镜像源:
vi /etc/docker/daemon.json
在json文件中添加内容:
{
"registry-mirrors" : [
"http://registry.docker-cn.com"
],
"insecure-registries" : [
"registry.docker-cn.com"
]
}
重新启动docker:?
systemctl restart docker
4、下载yml文件并启动EdgeX
curl https://raw.githubusercontent.com/edgexfoundry/edgex-compose/jakarta/docker-compose-no-secty.yml -o docker-compose.yml; docker-compose up -d
?执行上述步骤,如果出现下面的错误:
解决 curl: (7) Failed to connect to raw.githubusercontent.com port 443: 拒绝连接问题
执行命令:打开hosts文件?
sudo gedit /etc/hosts
在文件最后添加内容:
199.232.68.133 raw.githubusercontent.com
验证 EdgeX 容器是否已启动:
docker-compose ps
?如果所有 EdgeX 容器都正确拉出并启动且没有错误,您应该会看到类似于上图的进程状态 (ps)。
|