Docker

Fixing Slow Docker Pulls in Iran with the ArvanCloud Registry Mirror

Two ways to use docker.arvancloud.ir: prefixing image names, or registry-mirrors in daemon.json, following ArvanCloud's official documentation.

Fixing Slow Docker Pulls in Iran with the ArvanCloud Registry Mirror
Table of contents
  1. Option 1: prefix the image name (no Docker changes)
  2. Option 2: a global mirror (daemon.json)
  3. Two important notes
  4. A quick test

For servers inside Iran, pulling images from Docker Hub is sometimes extremely slow or fails outright. ArvanCloud’s Docker registry makes Docker Hub images available through the docker.arvancloud.ir domain, as described on the service’s official “Docker image registry” page.

Option 1: prefix the image name (no Docker changes)

Just put the registry name in front of the image:

docker pull docker.arvancloud.ir/library/nginx:latest
docker pull docker.arvancloud.ir/library/wordpress:latest
docker pull docker.arvancloud.ir/library/mariadb:10.11

This needs no change to the Docker service at all, and it is how this site’s own stack pulls its images: every image in its docker-compose.yml carries the docker.arvancloud.ir/ prefix.

Option 2: a global mirror (daemon.json)

If you want Docker to send every pull through the mirror automatically, edit /etc/docker/daemon.json:

{
  "registry-mirrors": ["https://docker.arvancloud.ir"]
}

Then restart the service:

sudo systemctl daemon-reload
sudo systemctl restart docker

From then on, a plain docker pull nginx also comes through the mirror, with no change to your commands. Restarting Docker restarts your containers too, so pick a quiet moment.

Two important notes

  • In Compose you can read the prefix from .env: image: ${MIRROR:-docker.arvancloud.ir}/library/wordpress:latest. Changing one variable switches the whole stack between Docker Hub and the mirror.
  • Official library/ images have the best coverage. If a particular image does not come through the mirror, you can pull it once somewhere else and push it to your own registry.

A quick test

Before deploying a full stack, try the mirror with a small image:

docker pull docker.arvancloud.ir/library/alpine:latest

If it finishes in a few seconds, you are ready.

About the author

Arash Karimian

Network and infrastructure engineer with years of day-to-day work on Linux servers, firewalls and network tuning. Writes about networking, security and server troubleshooting.

All articles by Arash Karimian

Comments

No comments yet. For technical questions, include the details (OS version, the exact error and the command you ran) to get a precise answer.

Leave a comment