CentOS7下Docker的安装教程
作者:碎豆芽 时间:2023-11-03 01:16:50
Docker简介
Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化。容器是完全使用沙箱机制,相互之间不会有任何接口。Docker 使用客户端-服务器 (C/S) 架构模式,使用远程API来管理和创建Docker容器。Docker 容器通过 Docker 镜像来创建。容器与镜像的关系类似于面向对象编程中的对象与类。官网地址:http://www.docker.com/
Docker安装
系统要求CentOS 7.X 以上版本,内核至少3.10,64-bit
1、uname –r 检查内核版本
2、vi /etc/profile 修改代理设置(如果需要设置代理。内容如下,**为密码,密码要避免含有@符号)
http_proxy=http://userName:password@10.16.236.108:3128/
ftp_proxy="http://userName:*****@10.16.236.108:3128/"
https_proxy="https://userName:*****@10.16.236.108:3128/"
export https_proxy
export http_proxy
export ftp_proxy
3、yum update 升级本地yum包
4、tee /etc/yum.repos.d/docker.repo <<-'EOF' 添加yum 仓库配置(内容见下框)
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
5、yum install docker-engine 安装docker包
6、service docker start 启动docker服务
7、mkdir /etc/systemd/system/docker.service.d
8、touch /etc/systemd/system/docker.service.d/http-proxy.conf 如果需要代理,添加docker程序代理(内容见下框)
[Service] 例子 [Service]
Environment="HTTP_PROXY=http://proxy.ip.com:80" Enviroment=”HTTP_PROXY=http://用户名:密码@代理地址:端口号”
11、systemctl daemon-reload
12、systemctl restart docker (第11、12步。为重启docker操作)
13、docker run hello-world 运行官方镜像hello world文件,检验是否安装成功。
来源:http://www.cnblogs.com/suidouya/p/5718104.html
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
新手慎防:2010年常见网赚骗局(二)
Google AdSense:广告放在网页什么位置?
![](https://img.aspxhome.com/file/UploadPic/20092/200925111141330.jpg)
IIS详细错误代码以及解释
Virtualbox主机和虚拟机之间文件夹共享及双向拷贝(Windows<->Windows, Windows<->Linux)
![](https://img.aspxhome.com/file/2023/5/101415_0s.png)
五招轻松应对邮件服务器攻击
图王:谈谈赚钱,与落伍的兄弟们一起分享
网站更换域名时的七个技巧(Google提供)
搜索引擎优化之长尾关键词理论及实战
![](https://img.aspxhome.com/file/UploadPic/200710/22/20071022132519866s.jpg)
全球最年轻女强人 揭秘谷歌第一美女梅耶尔
![](https://img.aspxhome.com/file/UploadPic/200910/20091016185410977.jpg)
两种隐性的无效广告展示
PJBlog3评论整合Gravatar全球通用头像API教程
如何让你的网站人见人爱
Linux下截屏并编辑的最佳工具
![](https://img.aspxhome.com/file/2023/7/72697_0s.jpg)
同一主机上WordPress更换域名方法
![](https://img.aspxhome.com/file/UploadPic/20103/19/20103199393245.gif)
启动VMware时遇到“vmx86版本不匹配问题”的完美处理方法
![](https://img.aspxhome.com/file/2023/5/86505_0s.png)
tomcat8改了jar加载顺序的踩坑记录
![](https://img.aspxhome.com/file/2023/0/93340_0s.jpg)