9-17 0 views
安装docker-ce
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
install_docker.sh echo "====> Removeing docker" yum remove -y docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine echo "====> Installing yum-utils" yum install -y yum-utils echo "====> Add Repo docker-ce" yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo echo "====> Installing docker-ce" yum install -y docker-ce docker-ce-cli containerd.io echo "====> Setting start docker when power-on" systemctl enable docker echo "====> Starting docker" systemctl start docker |
设置Docker的镜像及数据存放位置
1 2 3 4 5 6 7 8 9 10 11 12 |
systemctl stop docker sed -i '/ExecStart=/s/\/usr\/bin\/dockerd/\/usr\/bin\/dockerd\ --graph\ \/storage\/docker/g' /lib/systemd/system/docker.service grep ExecStart /lib/systemd/system/docker.service cp -Prf /var/lib/docker /storage/ systemctl daemon-reload systemctl start docker ps -ef |grep docker |
如果想赏钱,可以用微信扫描下面的二维码,一来能刺激我写博客的欲望,二来好维护云主机的费用; 另外再次标注博客原地址 itnotebooks.com 感谢!