Loading and Uploading Docker Images on AKS using Kubernetes

Procedure

  1. Update local docker config file. Remove previous config, if any.
    rm ~/.docker/config.json
    If using docker on MacOS, uncheck checkbox Securely store docker logins in macOS keychain.

    Default Docker Setting on MacOS:

    Updated Docker Setting on MacOS:

  2. Enable the Access Keys from the Azure Container Registry from the Azure Portal.

  3. Login into Azure Container Registry using admin user name and password from the Azure Portal.
    docker login <Azure Container Registry) -u <Admin UserName> -p <Password>
    Note: Any one of the password from the password list in Access keys.
    Sample Command for ACR Login:
    1.  docker login ml5acr.azurecr.io -u ml5acr -p <password copied from azure portal>
    2. Ref: https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication#individual-login-with-azure-ad
    3. Check: Once you login, please ensure that ~/.docker/config.json has credentials, under auth.
      cat ~/.docker/config.json
      {
          "auths": {
              "<acrName>.azurecr.io": {
                  "auth": "XXXXXXX"
              }
          },
          "HttpHeaders": {
              "User-Agent": "Docker-Client/17.12.0-ce (darwin)"
          }
  4. Run the following command to load docker images locally:
     ./load-images.sh path_to_docker_image_files
    Note: When deploying Mashery Local cluster in tml-installer, docker images are already loaded after a successful build. The above step can be skipped.
  5. Upload images to the container registry. Run the following command:
    ./upload-images.sh
  6. Run the following command to set registry secret for ACR:
    ./set-registry-secret.sh