Lightsail containers keep failing with no output

0

Hi,

This is the first time I try to use AWS Lightsail. I use it in us-east-1. I setup a nano single instance and try to run two containers - one with a Go program which talks to a database and one with Nginx front-end serving a React application.

For the sake of troubleshooting, I narrowed it down to just the Go program.

The Docker image I created on my laptop runs fine on my laptop, it can even open the connection to the database (I made the database public while debugging).

But when I push the image to Lightsail and try to deploy it, all I get is:

[1/Jan/2022:01:03:21] [deployment:8] Creating your deployment
[1/Jan/2022:01:04:31] [deployment:8] Started 1 new node
[1/Jan/2022:01:05:25] [deployment:8] Started 1 new node
[1/Jan/2022:01:06:34] [deployment:8] Started 1 new node
[1/Jan/2022:01:07:12] [deployment:8] Canceled

No matter what I try.

The container's ENTRYPOINT script prints some output (for instance, it executes env to show the environment), but I don't see it in the logs and the Go code is verbose when it starts up but I don't see the expected output in the logs either.

It also starts in about 5 seconds, including opening the connection to the database and running a few quick transactions on it, so I don't think it's a matter of slow start.

I couldn't find any other output or logs from Lightsail. The container takes about 3Mb of RAM when it runs on my laptop, way less than the 512Mb available on the Nano instance.

Similar issues happen with the container which runs Nginx. It's a custom container based on the official nginx:alpine image with my static files and extra config added to it. It runs fine on my laptop.

What am I doing wrong? Where else can I look for hints on why my deployments fail? I've been banging my head over this for three days now.

질문됨 2년 전887회 조회
2개 답변
0

Whatever your container prints to stderr and stdout should be captured in the logs. You may want to try running your start command using CMD instead of ENTRYPOINT.

AWS
Alex
답변함 2년 전
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.

Ondrej
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠