Skill 156 · Deploying Containers To Amazon Lightsail
Subchapter 156.4
references/public-image.mdMarkdown1 KBView on GitHub
The image already lives in a registry Lightsail can pull (Docker Hub, Amazon ECR Public), so there is no build and
no push — reference the image directly in the deployment. No docker or is needed for this path.
lightsailctlCreate the service and wait for READY (SKILL.md Workflow, step 1) — poll with:
aws lightsail get-container-services --service-name NAME --region REGIONDeploy with create-container-service-deployment. The image is the public reference (e.g.
public.ecr.aws/nginx/nginx:latest or docker.io/library/nginx:latest), and publicEndpoint.containerPort must
be the port the app listens on and appear in that container’s ports.
aws lightsail create-container-service-deployment \
--service-name NAME \
--containers '{"web":{"image":"public.ecr.aws/nginx/nginx:latest","ports":{"80":"HTTP"}}}' \
--public-endpoint '{"containerName":"web","containerPort":80,"healthCheck":{"path":"/"}}' \
--region REGIONPoll the deployment to ACTIVE and verify the URL — see deployment.md (opens in a new tab).
privateRegistryAccess on the service so Lightsail can pull it; it is not covered here.