Hello world container instance application terminates repeatedly on successful deploy

Peter 20 Reputation points
2023-04-06T13:47:07.8966667+00:00

Followed the 3-step tutorial for building and deploying a container instance described here:

https://learn.microsoft.com/nb-no/azure/container-instances/container-instances-tutorial-prepare-app

I've also tried building and launching the image described in this article (by recommandation from microsoft support), with the exact same result: https://www.site24x7.com/learn/build-docker-images-azure-container-registry.html

I am able to run the application locally, and all tutorial steps executes successfully.

  • I've verified that the azure docker registry has been created
  • I've verified that the docker image is available in the registry
  • The container instance using the uploaded image is launched successfully

However, after deploying successfully (according to azure cli / azure GUI), the app instantly terminates, and keeps restarting + terminating.
There are no errors, except for a warning that states that the container "is in a Waiting state and may not be running". I am using a Macbook Air M1.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
757 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Peter 20 Reputation points
    2023-04-06T15:07:56.4833333+00:00

    It appears M1 Macbooks target Arm64 by default. I was able to resolve it by specifying platform to the docker build command. E.g.:

    docker build --platform=linux/amd64 -t my-image .
    
    2 people found this answer helpful.
    0 comments No comments

  2. Sedat SALMAN 14,180 Reputation points MVP
    2023-04-06T14:27:19.5566667+00:00

    troubleshoot

    • check your container logs
    az container logs --resource-group <your-resource-group> --name <your-container-instance-name>
    
    • Check container instance events

    go to the "Events" tab for your container instance to see if there are any events related to the container's startup

    • Verify the Dockerfile

    Ensure that your Dockerfile is set up correctly, especially the CMD or ENTRYPOINT instructions that define how your application should start

    • if you have a chance Before deploying to Azure Container Instances, try running your container image locally using Docker
    0 comments No comments

  3. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2023-04-20T19:58:50.45+00:00

    @Peter We are glad you were able to resolve your issue. Thank you for coming back and sharing the resolution to the community. Please accept an answer on this case. This will make the thread more visible and help future community users. Thanks again and have a great day!

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

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