- Create directory /etc/systemd/system/docker.service.d if not exist
- Create mirror.conf file inside that directory. The name "mirror" can be changed to anything.
- In the file, add this lines
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd:// --registry-mirror=http://registry-host:registry-port
- registry-host is hostname/ip of your local registry mirror
- registry-port is port of your local registry mirror
- Flush the change with $ sudo systemctl daemon-reload
- Restart docker with $ sudo systemctl restart docker
- Check if the change is successfully applied with $ systemctl status docker, your config should appear somewhere in the command output.
Tested on Docker 1.11, Ubuntu 15.10 & 16.04
If you want more explanations about these commands, please refer to follow links. Thank you for all of them for providing me a direction to solve the issue and also come up with this post.
No comments:
Post a Comment