Azure docker container wont start

Rik Morskate 1 Reputation point
2021-08-09T17:42:23.107+00:00

Hello,

For the last couple of days I have been trying to get a Docker container running on Azure. I have a basic Laravel project and am using a basic Dockerfile and Azure pipeline and release pipeline.

The image is successfully pulled but afterwards is not starting. I am getting the following logs:

2021-08-09T17:22:37.829Z INFO - Status: Image is up to date for ******.azurecr.io/app:latest
2021-08-09T17:22:37.832Z INFO - Pull Image successful, Time taken: 0 Minutes and 0 Seconds
2021-08-09T17:22:37.879Z INFO - Starting container for site
2021-08-09T17:22:37.885Z INFO - docker run -d -p 3535:80 --name integration-docker_0_beec5a09 -e DOCKER_CUSTOM_IMAGE_NAME=******.azurecr.io/app:latest -e PORT=80 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=80 -e WEBSITE_SITE_NAME=integration-docker -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=integration-docker.azurewebsites.net -e WEBSITE_INSTANCE_ID=e55efd6783db50fae15b26e5ec67d28845ef537db278e9c1346becd2b2f1a777 -e HTTP_LOGGING_ENABLED=1 ******.azurecr.io/app:latest
2021-08-09T17:22:40.900Z INFO - Initiating warmup request to container integration-docker_0_beec5a09 for site integration-docker
2021-08-09T17:22:41.975Z ERROR - Container integration-docker_0_beec5a09 for site integration-docker has exited, failing site start
2021-08-09T17:22:41.978Z ERROR - Container integration-docker_0_beec5a09 didn't respond to HTTP pings on port: 80, failing site start. See container logs for debugging.
2021-08-09T17:22:41.985Z INFO - Stopping site integration-docker because it failed during startup.

I also see this error: standard_init_linux.go:219: exec user process caused: exec format error

Help is much appreciated.

Kind regards,
Rik

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
382 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Niko Mix 1 Reputation point
    2021-08-09T21:18:18.183+00:00

    The Issue is boils down to an Issue inside the container, which can come either by building the container from a different architecture than you container image or an issue executing your executable. Can you share your Dockerfile? Also the output from docker manifest inspect --verbose .azurecr.io/app:latest can help pinpoint the issue

    Otherwise these two links should point out the most common issues:

    0 comments No comments

  2. Rik Morskate 1 Reputation point
    2021-08-10T07:10:13.767+00:00

    Hi Nikomix,

    I saw those topics on Stackoverflow but my containter is being started by Azure. At least I see in the logs it's trying to.

    My Dockerfile:

    FROM php:8  
      
    # Install system dependencies  
    RUN apt-get update && apt-get install -y \  
        git \  
        curl \  
        libpng-dev \  
        libonig-dev \  
        libxml2-dev \  
        zip \  
        unzip  
      
    # Get latest Composer  
    RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer  
      
    # Install PHP extensions  
    RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd  
      
    WORKDIR /app  
    COPY . /app  
      
    RUN composer install  
      
    EXPOSE 80  
    

    I also tried to deploy a Dockerfile with php:7.4-fpm

    And I am using this azure pipeline yml

    # Docker  
    # Build and push an image to Azure Container Registry  
    # https://learn.microsoft.com/azure/devops/pipelines/languages/docker  
      
    trigger:  
    - main  
      
    resources:  
    - repo: self  
      
    variables:  
      # Container registry service connection established during pipeline creation  
      dockerRegistryServiceConnection: 'c64767bd-b4de-4a17-b058-7a69e0f096f4'  
      imageRepository: 'app'  
      containerRegistry: '****.azurecr.io'  
      dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'  
      tag: '$(Build.BuildId)'  
      
      # Agent VM image name  
      vmImageName: 'ubuntu-latest'  
      
    stages:  
    - stage: Build  
      displayName: Build and push stage  
      jobs:  
      - job: Build  
        displayName: Build  
        pool:  
          vmImage: $(vmImageName)  
        steps:  
        - task: Docker@2  
          displayName: Build and push an image to container registry  
          inputs:  
            command: buildAndPush  
            repository: $(imageRepository)  
            dockerfile: $(dockerfilePath)  
            containerRegistry: $(dockerRegistryServiceConnection)  
            tags: |  
              $(tag)  
    
    0 comments No comments