首页 > 解决方案 > I can´t pull image from azure ACR

问题描述

This is my first time using azure, I made a Pipeline in DevOps that creates images from dockerfile and pushes them to my ACR. Then I created a multi-container web app use docker-compose and connected my ACR to the web app. But the web app can't pull the images from the ACR. I don't know what I am doing wrong.

I am getting errors when I try to pull images from ACR in multi container web app.

Errors:

2019-11-28 19:27:46.755 INFO  - Pulling image: [registry-name].azurecr.io/server
2019-11-28 19:27:46.921 ERROR - DockerApiException: Docker API responded with status code=NotFound, response={"message":"manifest for [registry-name].azurecr.io/server:latest not found: manifest unknown: manifest unknown"}

Docker-compose config:

version: "3"

services:
  # SERVER CONTAINER

  server:
    image: [registry-name].azurecr.io/server
    expose:
      - 4000
    ports:
      - 4000:4000
    command: node src/server.js
    restart: always

  # CLIENT CONTAINER

  client:
    image: [registry-name].azurecr.io/client
    ports:
      - "80:80"
      - "443:443"
    links:
      - server
    depends_on:
      - server
    restart: unless-stopped

标签: azuredockerazure-container-serviceazure-container-registry

解决方案


First of all, the error shows that it cannot find the [registry-name].azurecr.io/server image with latest tag. So if your image does exist, then the problem is the tag.

If you do not add the tag for your image, it will pull the latest tag in default generally. The logs show like this:

enter image description here

But add a special tag for the image is better than no tag. If you want to get the latest image from the ACR, then always add the latest tag when push the image, do the same when you use that image.


推荐阅读