3台主机,2台都能正确安装,第三台怎么都安装不成功;
3台主机都是一样的配置和系统;
后来看来是其外网的ip不一样,导致第三台主机可能被Qiang,不过错误只是提示签名不正确,在设置签名时好像没有提示错误,只是在apt update时报错。
后改为阿里的源安装成功了。
以下安装参考(Ubuntu 20.04安装Docker - 知乎)
切换阿里云镜像源安装Docker
1、卸载可能存在的或者为安装成功的Docker版本
sudo apt-get remove docker docker-engine docker-ce docker.io
2、添加阿里云的GPG密钥
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
3、使用以下命令设置存储库
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
4、安装最新版本的Docker(飞速安装)
sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
5、验证Docker是否安装成功
-- 查看docker 版本docker version
启动Docker
1、安装完成后,运行如下命令验证 Docker 服务是否在运行
systemctl status docker
未运行:
2、运行以下命令启动Docker服务
sudo systemctl start docker
3、设置Docker服务在每次开机时自动启动
sudo systemctl enable docker
4、查看docker运行状态
systemctl status docker
验证Docker是否运行正常
注意:执行下面的命令会下载一个Docker测试镜像,并在容器中执行一个“hello-world”样例程序。
sudo docker run hello-world
如果你看到类似下方的输出,那么祝贺你,Docker能够正常运行在你的Ubuntu系统中了。
ubuntu@VM-16-10-ubuntu:~$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:53f1bbee2f52c39e41682ee1d388285290c5c8a76cc92b42687eecf38e0af3f0
Status: Downloaded newer image for hello-world:latestHello 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 theexecutable that produces the output you are currently reading.4. The Docker daemon streamed that output to the Docker client, which sent itto your terminal.To try something more ambitious, you can run an Ubuntu container with:$ docker run -it ubuntu bashShare 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/