当前位置: 首页 > news >正文

ubuntu20.04安装docker

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:latest

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/

相关文章:

  • chrome控制台报错就会进入debugger模式怎么取消
  • Solidity study
  • 编写一个程序,计算并输出1到100的和(Python版)
  • 7种内外网数据交换方案全解析 哪种安全、高效、合规?
  • C语言基本输入输出学习笔记
  • React + TypeScript 全栈开发最佳实践
  • 网络基础知识-2
  • spring中手写注解开发(创建对象篇)
  • Jenkins重启后Maven的Project加载失败
  • docker安装etcd:docker离线安装etcd、docker在线安装etcd、etcd镜像下载、etcd配置详解、etcd常用命令、安装常见问题总结
  • ViceVersa Pro: 2. 可靠的磁盘、服务器镜像及连续实时的服务器复制
  • 工具方法 - 合规性矩阵
  • BMS应用软件开发 — 13 Modbus协议详解
  • 机器学习中的嵌入(Embedding)学习笔记
  • 多模态人物视频驱动技术回顾与业务应用
  • 《迈向认知智能新高度:深度融合机器学习与知识图谱技术》
  • 一文读懂什么是K8s Admission Controller
  • C++ | 高级教程 | 命名空间
  • B2B订货系统在提升订单处理效率与准确性上,有哪些关键流程与机制?
  • 灵犀互娱游戏测试开发一面面经
  • 做网站java要什么/免费的行情网站
  • 各大网站投稿/免费做网站怎么做网站
  • 龙游网站制作/抖音seo怎么做的
  • 潍坊网站建设优化排名/晋江友情链接是什么意思
  • wordpress 评论显示图片/专业排名优化工具
  • 局域网内服务器做网站/上海网络推广联盟