docker安装以及镜像加速

来源:互联网 发布:成都知美术馆要门票吗 编辑:程序博客网 时间:2024/06/14 07:12

docker-engine install(centos7.2)

[root@docker ~]# vim /tmp/docker-ce-install.sh#/bin/bashyum install -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repoyum-config-manager --enable docker-ce-edgeyum-config-manager --enable docker-ce-testyum makecache fastyum install -y docker-ce #yum list docker-ce.x86_64  --showduplicatessystemctl enable dockersystemctl start docker

镜像加速
版本不同,方法不同,

新版本方法:[root@master ~]# vim /etc/systemd/system/multi-user.target.wants/docker.serviceExecStart=/usr/bin/dockerd --registry-mirror=https://jxus37ad.mirror.aliyuncs.com老版本方法:[root@node01 ~]# vim /etc/docker/daemon.json{        "registry-mirrors":["https://jxus37ad.mirror.aliyuncs.com"]}systemctl daemon-reloadsystemctl restart docker.service