How to deploy Amazon Linux on a Lightsail Container Service?

0

Hi, I'm trying to deploy Amazon Linux from this public repo public.ecr.aws/amazonlinux/amazonlinux:2018.03 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,

Frank

4 Answers
1
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

--Syd

profile picture
answered 2 years ago
profile picture
EXPERT
reviewed 6 months ago
0

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,

Frank

answered 2 years ago
0

I am having the same issue with postgres. For example registry.hub.docker.com/postgres:14-alpine does NOT work. But registry.hub.docker.com/containous/whoami works without issue. Both are not custom, they are public containers... how can I run Postgres?

answered 2 years ago
0

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 2 years 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