docker安装手册

docker 安装手册

环境 cent os 7.x
版本 docker v18.09.5

参考自官方文档

1 卸载旧版本

sudo yum remove docker \
                  docker-common \
                  docker-selinux \
                  docker-engine

2 安装所需的软件包

sudo yum install -y yum-utils device-mapper-persistent-data lvm2

3 配置docker源 (注意,此处已替换成阿里镜像,否则奇慢无比)

sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

4 安装docker

sudo yum makecache fast
sudo yum -y install docker-ce

5 配置阿里镜像数据源

访问地址

1.png
配置信息
  • 每个人的源地址都不一样,目前是免费的
  • 直接复制粘贴 上述命令 执行
  • 运行 cat /etc/docker/daemon.json,看看有没有命令上的registry-mirrors

6 运行 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/

出现这个日志说明成功

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容