Lightsail "push-container-image" failed in CI
aws lightsail push-container-image uploads a local Docker image into a Lightsail container service. It fails when the lightsailctl plugin is missing, the local image reference is wrong, or the service does not exist.
What this error means
The push step fails with "Lightsail Control (lightsailctl) plugin was not found", "image not found", or a service-not-found error before the image is uploaded.
Error: The Lightsail Control (lightsailctl) plugin was not found.
To download and install it, see
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-install-softwareCommon causes
The lightsailctl plugin is not installed
push-container-image shells out to the lightsailctl plugin. On a fresh runner the plugin is absent, so the command cannot perform the upload.
A wrong local image tag or missing service
The local image label does not exist (it was never built/tagged), or the target container service name is wrong, so there is nothing valid to push.
How to fix it
Install lightsailctl before pushing
- Download and install the lightsailctl plugin on the runner.
- Build and tag the local image first.
- Run push-container-image against the existing service.
curl -sL "https://s3.us-west-2.amazonaws.com/lightsailctl/latest/linux-amd64/lightsailctl" \
-o /usr/local/bin/lightsailctl && chmod +x /usr/local/bin/lightsailctlPush an existing local image to an existing service
Confirm the image label and the container service name match, then push.
aws lightsail push-container-image \
--service-name myapp --label web --image myapp:latestHow to prevent it
- Install lightsailctl as a setup step on the runner.
- Build and tag the image before the push step.
- Create the container service before pushing images to it.