[Docker]安装

生产环境

[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

posted @ 2020-02-24 08:53  LeoShi2020  阅读(134)  评论(0编辑  收藏  举报