标签:
关于centos7安装docker,作为初学者百度了不少,深深感到百度跟谷歌的差距,百度遇到了各式各样的错误,基本上和那一堵墙有关,没办法,直接搜英文文档,才安装好,下面是步骤:
原网址是http://www.liquidweb.com/kb/how-to-install-docker-on-centos-7/
As a matter of best practice we’ll update our packages: //更新您的包
yum -y update // 安装命令1
Now let’s install Docker by installing the docker-io package: //通过docker-io包进行安装
yum -y install docker docker-registry //安装命令2
Set the Docker service to start at boot: //设为开机启动(不知道有木有翻译对)
systemctl enable docker.service //安装命令3
Then start the Docker service: //启动docker服务
systemctl start docker.service //安装命令4
And verify your work by checking the status of Docker: //查看docker状态
systemctl status docker.service //命令5
Let’s begin using Docker! Download the centos Docker image: //开始使用docker,下载centos的docker镜像
docker pull centos //下载ceneos命令 注意:下载时候这句命令可能会因为网络原因报错,你要多试几次,等一等
Now, to setup a basic <reference_page_text>centos container with a bash shell, we just run one command. <reference_page_text>docker run will run a command in a new container, <reference_page_text>-i attaches stdin and stdout, <reference_page_text>-t allocates a tty, and we’re using the standard<reference_page_text>fedora container.
docker run -i -t centos /bin/bash //基本完成了到了这一步,这是打开,关闭使用exit这个单词命令就可以
That’s it! You’re now using a bash shell inside of a centos docker container.
To disconnect, or detach, from the shell without exiting use the escape sequence Ctrl-p + Ctrl-q.
There are many community containers already available, which can be found through a search. In the command below I am searching for the keyword <reference_page_text>centos:
docker search centos //这个是查询,失败了无所谓了,上面的步骤已经完毕了
如果报错误,很可能是你centos内核没有进行升级
http://blog.csdn.net/jiangzhengdong/article/details/8036594 这是升级网址
http://www.linuxidc.com/Linux/2014-07/104768.htm 其他参考
先期环境准备还有EPEL http://www.tuicool.com/articles/umQnQf 参考
感谢各位资料分享者,此处有不足的地方请斧正,感谢
标签:
原文地址:http://www.cnblogs.com/GengChao/p/4468967.html