builddocker-registryazure-cliazure-acr

az acr build authentication for private docker registry with base images


We have some base images in private ACR and we would like to build images in other ACR using base images from the first registry. The build fails with authentication error.

Is there a way how to authorize az acr build agent to remote docker registry or different ACR?


Solution

  • You can't directly use the build command to build an image in target registry from base image in base registry. Because az acr build supports only these source Locations: The local source code directory path (e.g. './src'), or the URL to a git repository(e.g. https://github.com/Azure-Samples/acr-build-helloworld-node.git)

    You can Import container images to a container registry

    az acr import \
      --name myregistry \
      --source docker.io/library/hello-world:latest \
      --image hello-world:latest