skip to Main Content

I’m creating my first app on AWS App Runner. I have a simple nginx Docker image that works locally by serving html on localhost:8080.

When I try to deploy it, the result is "Create Failed". Upon digging into the CloudWatch logs, I see that the health check failed. The health check is configured to ping the root of the service "/" at port 8080.

2

Answers


  1. Chosen as BEST ANSWER

    I was able to resolve this by deleting my App Runner app (this is currently the only way to change the configuration-- see this issue), then creating a new one and specifying the health check to ping port 80.


  2. Are you getting this error:

    10-21-2021 02:13:32 PM [AppRunner] Health check on port '80' failed. Service is rolling back. Check your configured port number. For more information, read the application logs.
    10-21-2021 02:07:40 PM [AppRunner] Performing health check on port '80'.
    10-21-2021 02:07:30 PM [AppRunner] Provisioning instances and deploying image.
    10-21-2021 02:07:20 PM [AppRunner] Successfully pulled image from ECR.
    10-21-2021 02:04:58 PM [AppRunner] Service status is set to OPERATION_IN_PROGRESS.
    10-21-2021 02:04:57 PM [AppRunner] Service creation started.
    

    If you are building on an M1 mac by chance? If so that’s probably the reason. The image that’s being built is of the ARM architecture, and App Runner or Fargate is an x86 runtime.

    Aws is working on fixing this issue here: #1949

    In the meantime, there’s a workaround, you can prefix copilot commands with the DOCKER_DEFAULT_PLATFORM=linux/amd64

    For example:

    DOCKER_DEFAULT_PLATFORM=linux/amd64 copilot deploy
    

    So basically when you build your docker image just use:

    You can use buildx (mobi) which suipport cli for platform.

    docker build --platform linux/amd64 -t your-docker-image-name .
    

    Hope that helps, and sorry for the trouble 🙏

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search