Docker solution for downloading images slowly
- 2020-05-24 06:28:25
- OfStack
docker resolves slow download image
Use Docker pull to mirror this super slow, because docker hub is in a foreign country, so it is extremely slow, is there any way to solve this problem? The answer is definitely yes, we can use the agent of docker to solve this problem, we need to prepare a usable agent of http.
The proxy Settings
The system used in this article is fedora
Create an docker service directory
mkdir /etc/systemd/system/docker.service.d
Create/etc systemd/system/docker service. d/http - proxy. conf file, ripped agent to write to a file
vim /etc/systemd/system/docker.service.d/http-proxy.conf
The file contents are as follows
[Service]
Environment="HTTP_PROXY=http:// agent ip: port"
Let the configuration file take effect
systemctl daemon-reload
Restart docker
systemctl restart docker.service
Try pull1 mirror
docker pull jenkins
Thank you for reading, I hope to help you, thank you for your support of this site!