/
STFC Docker Hub Mirror

STFC Docker Hub Mirror

Introduction

The STFC cloud team provides an internal Docker Hub mirror at https://dockerhub.stfc.ac.uk which is strongly recommended; users avoid rate limit issues, can pull large images faster over the local network and is free.

Docker Hub limit an IP to 100 pulls per 6 hours. Instances with floating IPs will have separate rate limits, whilst all other instances use a shared limit (as all pulls come from a single external IP).

Docker will automatically fall back to using Docker Hub directly if the mirror is ever unavailable, so there is minimal risk to applying these changes.

New Instances

By default all new STFC Cloud instances will use the mirror by default. To confirm the mirror is being used see STFC Docker Hub Mirror | Checking that the mirror is being used.

Existing Instances

Existing instances will automatically update to pull in the required file described here STFC Docker Hub Mirror | Restarting Docker. A restart of the instance or docker service is required to start using the mirror.

Checking that the mirror is being used

Checking configuration exists

Users can quickly check if they have the mirror configuration present by running:

cat /etc/docker/daemon.json

An output similar to this indicates that the configuration is present:

{ "registry-mirrors": ["https://dockerhub.stfc.ac.uk"] }

To check whether the docker daemon is using this config you can run the following:

docker info

An output which includes the following near the bottom will indicate that the mirror is being used:

Monitoring Logs

For further peace of mind the logs can be checked. Docker will not produce any logs when pulling from the mirror successfully but will log an error if it fails to use direct connections:

  • Select an image which has not been pulled on the System before, for example Ubuntu or Debian latest.

  • In a separate terminal run a docker pull of your image:

  • If the mirror could be contacted there will be no output in the logs about it

  • If the mirror could not be used something similar to this will appear:

For more support see STFC Docker Hub Mirror | Troubleshooting Mirror Connection.

Manually Configuring the Mirror

For most users this is not required; instances will automatically update the file as described in