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
docker安装手册_第1张图片
配置信息
  • 每个人的源地址都不一样,目前是免费的
  • 直接复制粘贴 上述命令 执行
  • 运行 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/

出现这个日志说明成功

你可能感兴趣的:(docker安装手册)