DockerApiException when loading mongo from docker.io via docker-compose.yml

Tobias Weber 6 Reputation points
2022-06-09T11:38:34.943+00:00

We have a webapp running continuously since over a year now with no change. Now it's not running anymore with the following message in the log:

2022-06-07T15:14:29.087Z INFO  - Pulling image: mongo:4.0.8  
2022-06-07T15:14:29.777Z ERROR - DockerApiException: Docker API responded with status code=InternalServerError, response={"message":"Get https://registry-1.docker.io/v2/library/mongo/manifests/4.0.8: unauthorized: incorrect username or password"}  
  
2022-06-07T15:14:29.778Z ERROR - Pulling docker image mongo:4.0.8 failed:  
2022-06-07T15:14:29.784Z WARN  - Image pull failed. Defaulting to local copy if present.  
2022-06-07T15:14:29.786Z ERROR - Image pull failed: Verify docker image configuration and credentials (if using private repository)  
2022-06-07T15:14:29.787Z ERROR - multi-container unit was not started successfully  

The docker-compose.yml:

version: '3.1'  
  
services:   
  web:  
    build: .  
    container_name: flask  
    ports:   
      - '5000:5000'  
    volumes:   
      - .:/usr/src/app  
    links:   
      - mongodb  
  
    environment:  
      APP_ENV: "prod"  
      APP_DEBUG: "False"  
      APP_PORT: 5000  
      MONGODB_DATABASE: flaskdb  
      MONGODB_USERNAME: mongodbuser  
      MONGODB_PASSWORD: password  
      MONGODB_HOSTNAME: mongodb  
    
  mongodb:  
    image: mongo:4.0.8  
    container_name: mongodb  
    environment:  
      MONGO_INITDB_ROOT_USERNAME: mongodbuser  
      MONGO_INITDB_ROOT_PASSWORD: password  
      MONGO_INITDB_DATABASE: flaskdb  
      MONGODB_DATA_DIR: /data/db  
      MONDODB_LOG_DIR: /dev/null  
    volumes:  
      - mongodbdata:/data/db  
    
volumes:  
  mongodbdata:  
    driver: local  

Any ideas?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
{count} vote

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,326 Reputation points Microsoft Employee Moderator
    2022-06-30T16:29:08.34+00:00

    Hi @Tobias Weber ,

    We've determined the issue is related to a recent change that removed (for security reasons) the unauthenticated fallback for image pulls from docker hub. There isn't an ETA on when no auth option will be added back so for now, continue using your private registry for that image.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.