标签:docker 镜像
场景:在服务器上配置Docker的时候,当我们觉得比较慢的时候,可以跳过配置加速服务来进行
在服务器上的操作:
[root@LVS-DR01 ~]# vim /usr/lib/systemd/system/docker.service Environment=DOCKER_HTTP_HOST_COMPAT=1 Environment=PATH=/usr/libexec/docker:/usr/bin:/usr/sbin ExecStart=/usr/bin/dockerd-current --registry-mirror=https://ag3w25ij.mirror.aliyuncs.com --add-runtime docker-runc=/usr/libexec/docker/docker-runc-current --default-runtime=docker-runc --exec-opt native.cgroupdriver=systemd --userland-proxy-path=/usr/libexec/docker/docker-proxy-current $OPTIONS $DOCKER_STORAGE_OPTIONS $DOCKER_NETWORK_OPTIONS $ADD_REGISTRY $BLOCK_REGISTRY $INSECURE_REGISTRY $REGISTRIES ExecReload=/bin/kill -s HUP $MAINPID LimitNOFILE=1048576 LimitNPROC=1048576 LimitCORE=infinity TimeoutStartSec=0 Restart=on-abnormal MountFlags=slave KillMode=process [Install] WantedBy=multi-user.target 说明:--registry-mirror=https://ag3w25ij.mirror.aliyuncs.com 重新加载服务: [root@LVS-DR01 ~]# systemctl daemon-reload [root@LVS-DR01 ~]# systemctl restart docker [root@LVS-DR01 ~]# systemctl status docker ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2017-10-10 14:52:00 CST; 5s ago Docs: http://docs.docker.com Main PID: 15440 (dockerd-current) CGroup: /system.slice/docker.service ├─15440 /usr/bin/dockerd-current --registry-mirror=https://ag3w25ij.mirror.aliyuncs.com --add-runtime docker-runc=/usr/libexec/docker/... └─15450 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --shim docker-containerd-shi... Oct 10 14:51:59 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:51:59.958764236+08:00" level=warning msg="Docker could n...ystem" Oct 10 14:51:59 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:51:59.999187185+08:00" level=info msg="Graph migration t...conds" Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:51:59.999815473+08:00" level=info msg="Loading container...tart." Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:52:00.167327215+08:00" level=info msg="Firewalld running: false" Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:52:00.382002365+08:00" level=info msg="Default bridge (d...dress" Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:52:00.469707171+08:00" level=info msg="Loading containers: done." Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:52:00.469839570+08:00" level=info msg="Daemon has comple...ation" Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:52:00.469858378+08:00" level=info msg="Docker daemon" co...1.12.6 Oct 10 14:52:00 LVS-DR01.saltstack.com systemd[1]: Started Docker Application Container Engine. Oct 10 14:52:00 LVS-DR01.saltstack.com dockerd-current[15440]: time="2017-10-10T14:52:00.501638339+08:00" level=info msg="API listen on /va....sock" Hint: Some lines were ellipsized, use -l to show in full.
测试下载一个镜像
[root@LVS-DR01 ~]# docker pull alpine Using default tag: latest Trying to pull repository docker.io/library/alpine ... latest: Pulling from docker.io/library/alpine 88286f41530e: Pull complete Digest: sha256:f006ecbb824d87947d0b51ab8488634bf69fe4094959d935c0c103f4820a417d
当然也可以参考阿里云上的方法进行调整
本文出自 “冰冻vs西瓜” 博客,请务必保留此出处http://molewan.blog.51cto.com/287340/1973363
标签:docker 镜像
原文地址:http://molewan.blog.51cto.com/287340/1973363