Skip to content
Latchkey

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.

lightsail
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-software

Common 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

  1. Download and install the lightsailctl plugin on the runner.
  2. Build and tag the local image first.
  3. Run push-container-image against the existing service.
Terminal
curl -sL "https://s3.us-west-2.amazonaws.com/lightsailctl/latest/linux-amd64/lightsailctl" \
  -o /usr/local/bin/lightsailctl && chmod +x /usr/local/bin/lightsailctl

Push an existing local image to an existing service

Confirm the image label and the container service name match, then push.

Terminal
aws lightsail push-container-image \
  --service-name myapp --label web --image myapp:latest

How 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.

Frequently asked questions

What causes ""push-container-image" failed"?
push-container-image shells out to the lightsailctl plugin. On a fresh runner the plugin is absent, so the command cannot perform the upload.
How do I fix "push-container-image" failed?
Install lightsailctl before pushing

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card