sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv \
--keyserver hkp://ha.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt-get update
apt-cache policy docker-engine
sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
sudo apt-get install docker-engine
sudo usermod -aG docker ${普通用户名}(此命令是将普通用户添加至用户组)
sudo service docker start
sudo vi /lib/systemd/system/docker.service (增加私服地址)
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd://--insecure-registry ${私服IP}:${私服Port}
ExecReload=/bin/kill -s HUP $MAINPID
sudo systemctl daemon-reload (重新加载配置文件)
sudo service docker restart (重启docker服务)
docker info (查看配置是否生效)
Insecure Registries:
${私服IP}:${私服Port}
127.0.0.0/8
网友评论