feat(dockerhub-mirror) set up a new dedicated ACR to mirror DockerHub inside the Jenkins Azure infrastructure #794
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to jenkins-infra/helpdesk#4192
Fixup of 91cf2dc
Reference Azure documentation: https://learn.microsoft.com/en-us/azure/container-registry/container-registry-artifact-cache?pivots=development-environment-azure-portal
This PR introduces an Azure Container Registry set up as a DockerHub mirror using a "Cache Rule" which mirrors
docker.io/*
to*
(note: it forbids us to use other caching mechanism!).This registry has the following properties:
The registry is available for the following (heavy DockerHub users) services (I've only setup the Azure ephemeral VM agents subnets for now) through a combination of (private endpoint with a NIC in the subnet + private DNS zone with automatic records + inbound and outbound NSG rules):
Azure makes it mandatory to log-in on DockerHub for such a mirror system. As such, we use a distinct token stored in an Azure Keyvault which is "Public Images Read Only" associated to the
jenkinsciinfra
organization to avoid the "application" rate limit (e.g. 5k pull / day / IP) and only have the DockerHub anti-abuse system as upper limit (which seems to be a combination of requests and amount of data).Testing and approving
This PR is expected to have no changes in the plan as it was applied manually:
dockerhubmirror.azurecr.io
and should resolve to an IP local to the VM subnetNetwork Watcher
->Connection troubleshoot
)https://dockerhubmirror.azurecr.io
terraform apply
commands as documented, because the ACR componentCredentialSet
is not supported by Terraform yet (see comments in TF code).