码迷,mamicode.com
首页 > 其他好文 > 详细

[Docker]安装

时间:2020-02-24 09:50:44      阅读:62      评论:0      收藏:0      [点我收藏+]

标签:创建文件   release   href   http   hat   yum   加速   启动服务   添加   

生产环境

[root@Nexus3 ~]# cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)
[root@Nexus3 ~]# docker version
Client:
 Version:         1.13.1
 API version:     1.26
 Package version: docker-1.13.1-103.git7f2769b.el7.centos.x86_64
 Go version:      go1.10.3
 Git commit:      7f2769b/1.13.1
 Built:           Sun Sep 15 14:06:47 2019
 OS/Arch:         linux/amd64

Server:
 Version:         1.13.1
 API version:     1.26 (minimum version 1.12)
 Package version: docker-1.13.1-103.git7f2769b.el7.centos.x86_64
 Go version:      go1.10.3
 Git commit:      7f2769b/1.13.1
 Built:           Sun Sep 15 14:06:47 2019
 OS/Arch:         linux/amd64
 Experimental:    false

安装Docker服务

yum install -y docker

添加代理

官方原文(英)

-----创建文件夹-------------------------
mkdir -p /etc/systemd/system/docker.service.d
-----修改配置文件-------------------------
cat > /etc/systemd/system/docker.service.d/http-proxy.conf <<'EOF'
[Service]
Environment="HTTP_PROXY=http://10.1.46.19:3128/"
EOF

国内源加速

cat > /etc/docker/daemon.json << 'EOF'
{
"registry-mirrors": [
"https://kfwkfulq.mirror.aliyuncs.com",
"https://2lqq34jg.mirror.aliyuncs.com",
"https://pee6w651.mirror.aliyuncs.com",
"https://registry.docker-cn.com",
"http://hub-mirror.c.163.com"
],
"dns": ["114.114.114.114","8.8.4.4"]
}
EOF

启动服务

systemctl restart docker && systemctl enable docker

END

[Docker]安装

标签:创建文件   release   href   http   hat   yum   加速   启动服务   添加   

原文地址:https://www.cnblogs.com/leoshi/p/12355515.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!