How to deploy Amazon Linux on a Lightsail Container Service?


Hi, I'm trying to deploy Amazon Linux from this public repo on my Lightsail Container Service.

I don't specify any specific launch command.

I'm using a Micro instance: Micro (1 GB RAM, 0.25 vCPUs) ×1 node

The deployment starts and the fails and this is the log output:

[26/Aug/2022:10:09:32] [deployment:1] Creating your deployment
[26/Aug/2022:10:10:22] [deployment:1] Started 1 new node
[26/Aug/2022:10:11:42] [deployment:1] Started 1 new node
[26/Aug/2022:10:12:51] [deployment:1] Started 1 new node
[26/Aug/2022:10:13:33] [deployment:1] Canceled

Do I need to specify some command or what is the problem here? I want to use this image as a foundation to locally deploy my own written application in it and make it available on the net using the Lightsail Container Service.

Best Regards,


4 Answers
Accepted Answer

Hi Frank,

You need to ensure there is a process running in the foreground to keep the container running. Since you mentioned that you have not specified a launch command, it then depends on the command set to be run by default when the image is launched ie ENTRYPOINT or CMD settings

Its a bit unclear if you are directly launching a container using amazonlinux:2018.03 or a custom image which includes your application built on top of amazonlinux:2018.03. If you are directly using amazonlinux:2018.03 without any launch command in Lightsail then you can expect the deployment to fail since there is no process running in the foreground. It executes the shell and exits. Also you actually need to build a custom image locally, upload it to repository and then use that image in the container definition so as to have the application running in Lightsail. If you are already using the custom image, then the previous comment about process running the foreground would be the likely cause based on info shared. In either case you can validate that by running the image locally without any arguments to verify if the container is running or exits


profile picture
answered 2 years ago

Thank you for your answer. So far I‘m using just a plain AmazonLinux-Image, no app installed so far. What was confusing me: I could run the AmazonLinux-Image on my local docker installation and connecting to it using a shell. But I guess this does not work in Lightsail containers. So I will build my own docker image based on AmazonLinux with my test app deployed on it.

Once again thank you a lot - your answer makes totally sense.

Best Regards,


answered 2 years ago

I am having the same issue with postgres. For example does NOT work. But works without issue. Both are not custom, they are public containers... how can I run Postgres?

answered a year ago

If using Amazon ECR private repositories, make sure the repository is connected in the Images tab of the service deployment.

If not connected (or if you are using a different image, ehm) it will give no error but cancel the deployment.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions