Docker安装过程

安装 Docker  

源自:http://www.runoob.com/docker/centos-docker-install.html

从 2017 年 3 月开始 docker 在原来的基础上分为两个分支版本: Docker CE 和 Docker EE。

Docker CE 即社区免费版,Docker EE 即企业版,强调安全,但需付费使用。

本文介绍 Docker CE 的安装使用。

移除旧的版本:

$ sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-selinux \
                  docker-engine-selinux \
                  docker-engine

安装一些必要的系统工具:

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

添加软件源信息:

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

更新 yum 缓存:

sudo yum makecache fast

安装 Docker-ce:

sudo yum -y install docker-ce

启动 Docker 后台服务

sudo systemctl start docker

测试运行 hello-world

[root@runoob ~]# docker run hello-world
如果 run helloworld失败则采用这一句
docker run learn/tutorial echo
"hello word"


docker run learn/tutorial echo "hello word"

如果服务器启动时出现错误提示信息:

 

是因为按照DaoCloud执行了一下 curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://*******.m.daocloud.io 语句,然后 在这个文件中的/etc/docker/daemon.json 格式就变了{"registry-mirrors": ["http://****.m.daocloud.io"],} 最后一个多了一个逗号,我猜测是这个shell语句的原因,我把逗号去掉以后,程序可以正常启动。
posted @ 2018-10-07 23:08  saintdingtheGreat  阅读(153)  评论(0编辑  收藏  举报