6

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.

Spencer Goff
  • 1,036
  • 3
  • 14
  • 23
  • Happens to me as well. Wired enough, when I create a new App Runner instance with the exact same configurations, health check passes through and the service is being created successfully. Did you get your hands around it eventually? – Yotam Raz May 09 '22 at 13:18

3 Answers3

4

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.

Spencer Goff
  • 1,036
  • 3
  • 14
  • 23
3

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

Lonare
  • 3,581
  • 1
  • 41
  • 45
0

Does your application come up fine locally when running as a docker container?

The localhost needs to point to 0.0.0.0 ip rather than 127.0.0.1 or localhost to work on apprunner

Vincent Claes
  • 3,960
  • 3
  • 44
  • 62