0

I am currently working in a azure project where we need a way to push the image to public registries - it can be Azure ACR or docker registry.

Looks like Azure doesnt support anonymous read-access to Azure ACR. Hence only way is to push image to docker registry and pull the image form docker registry during container deployment in azure.

Is it possible? If so, how can I use azure template to achieve it? Any example please?

1 Answer 1

3

I thinks it is possible to create the azure container by using imageRegistryCredentials property, you could refer to the sample template.

{
  "name": "string",
  "type": "Microsoft.ContainerInstance/containerGroups",
  "apiVersion": "2018-04-01",
  "location": "string",
  "tags": {},
  "properties": {
    "containers": [
      {
        "name": "string",
        "properties": {
          "image": "string",
          "command": [
            "string"
          ],
          "ports": [
            {
              "protocol": "string",
              "port": "integer"
            }
          ],
          "environmentVariables": [
            {
              "name": "string",
              "value": "string"
            }
          ],
          "resources": {
            "requests": {
              "memoryInGB": "number",
              "cpu": "number"
            },
            "limits": {
              "memoryInGB": "number",
              "cpu": "number"
            }
          },
          "volumeMounts": [
            {
              "name": "string",
              "mountPath": "string",
              "readOnly": boolean
            }
          ]
        }
      }
    ],
    "imageRegistryCredentials": [
      {
        "server": "string",
        "username": "string",
        "password": "string"
      }
    ],
    "restartPolicy": "string",
    "ipAddress": {
      "ports": [
        {
          "protocol": "string",
          "port": "integer"
        }
      ],
      "type": "Public",
      "ip": "string",
      "dnsNameLabel": "string"
    },
    "osType": "string",
    "volumes": [
      {
        "name": "string",
        "azureFile": {
          "shareName": "string",
          "readOnly": boolean,
          "storageAccountName": "string",
          "storageAccountKey": "string"
        },
        "emptyDir": {},
        "secret": {},
        "gitRepo": {
          "directory": "string",
          "repository": "string",
          "revision": "string"
        }
      }
    ]
  }
}

For more details, you could refer to this link.

enter image description here

If the image is public, the password is not required.

enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

how do u make image public ?
@ForeverLearner I think your question is out of the post theme, here is an article for you to refer to, if my reply is helpful, you could mark it as answer to close it and ask the question of the usage of docker in another post. Thanks a lot.:-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.