本文共 2521 字,大约阅读时间需要 8 分钟。
现在docker 在原来的基础上分为两个分支版本: Docker CE 和 Docker EE。Docker CE 即社区免费版,Docker EE 即企业版,需付费使用。个人使用Docker CE 好了
[root@host01 ~]# yum remove -y docker \docker-client docker-client-latest \docker-common docker-latest \docker-latest-logrotate \docker-logrotate docker-selinux \docker-engine-selinux docker-engine已加载插件:fastestmirror参数 docker 没有匹配参数 docker-client 没有匹配参数 docker-client-latest 没有匹配参数 docker-common 没有匹配参数 docker-latest 没有匹配参数 docker-latest-logrotate 没有匹配参数 docker-logrotate 没有匹配参数 docker-selinux 没有匹配参数 docker-engine-selinux 没有匹配参数 docker-engine 没有匹配不删除任何软件包[root@host01 ~]#
[root@host01 ~]# yum install -y yum-utils device-mapper-persistent-data lvm2
[root@host01 ~]# yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo已加载插件:fastestmirroradding repo from: https://download.docker.com/linux/centos/docker-ce.repograbbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.reporepo saved to /etc/yum.repos.d/docker-ce.repo[root@host01 ~]#
[root@host01 ~]# yum install -y docker-ce
[root@host01 ~]# systemctl start docker
[root@host01 ~]# docker run hello-worldUnable to find image 'hello-world:latest' locallylatest: Pulling from library/hello-world1b930d010525: Pull complete Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4eStatus: 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 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 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/[root@host01 ~]#
1、要先注册一个阿里云的账号然后登陆到阿里云的【容器镜像服务】页面,地址:
2、在下面截图处找到加速器地址 3、复制阿里云上提供的直接命令直接运行即可sudo mkdir -p /etc/dockersudo tee /etc/docker/daemon.json <<-'EOF'{ "registry-mirrors": ["https://xxx.mirror.aliyuncs.com"]}EOFsudo systemctl daemon-reloadsudo systemctl restart docker
转载地址:http://uulwb.baihongyu.com/