2.3 安装校验:
root@iZbp12adskpuoxodbkqzjfZ:$ docker version
Client:
Version: 17.03.0-ce
API version: 1.26
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 07:52:04 2017
OS/Arch: linux/amd64
Server:
Version: 17.03.0-ce
API version: 1.26 (minimum version 1.12)
Go version: go1.7.5
Git commit: 3a232c8
Built: Tue Feb 28 07:52:04 2017
OS/Arch: linux/amd64
Experimental: false
2.4 添加加速器:
https://cr.console.aliyun.com/cn-beijing/instances/mirrors
(1). ubuntu加速器:
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://7cwrq8d9.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
(2). centos加速器:
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://7cwrq8d9.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
(3). 查看docker加速器:
docker info
3. 如何将docker容器配置成开机自启动:
(1). centos:
①. 检查服务是否开机启动:
sudo systemctl is-enabled docker.service
disabled
②. 将服务配置成开机启动:
sudo systemctl enable docker.service
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
③. 启动服务:
sudo systemctl start docker.service
④. 禁止开机启动:
systemctl disable docker.service
⑤. 停止:
systemctl stop docker.service
⑥. 重启:
systemctl restart docker.service
标签:systemctl,service,sudo,etc,version,加速器,docker
From: https://blog.51cto.com/u_16255561/7710619