docker-install && config
2017-12-08 本文已影响29人
Aapon
docker install 指定版本
添加docker 阿里云源
1.cat >/etc/apt/sources.list.d/docker-main.list<<EOF
deb [arch=amd64] http://mirrors.aliyun.com/docker-engine/apt/repo ubuntu-xenial main
EOF
2. Add Docker’s official GPG key
curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
3. apt update
apt-get update && apt-get upgrade -y
4. remove old docker verison
apt-get purge lxc-docker*
5. list docker vesion
apt-cache policy docker-engine
6. install docker version
apt-get install -y docker-engine=17.03.0~ce-0~ubuntu-xenial
docker config
- Docker Config Registry
- vi /lib/systemd/system/docker.service 在ExecStart后面添加如下命令:--insecure-registry=172.0.0.1 此IP根据私有仓库调整
- systemctl daemon-reload
- systemctl restart docker
- Docker Config proxy
- vi /lib/systemd/system/docker.service 在ExecStart后面添加如下命令:--registry-mirror=https://n9h3vi0d.mirror.aliyuncs.com
- systemctl daemon-reload
- systemctl restart docker
- Docker Root Dir Config
- vi /etc/docker/daemon.json 如没此文件,创建,添加:
{
"graph": "/mnt/data-docker"
} - systemctl daemon-reload
- systemctl restart docker
参考:
https://docs.docker.com/
https://www.xtplayer.cn/2017/02/2783