Deploy your image

You now replace the nginx image with your own image. Lightsail creates version 2 of the deployment and keeps version 1, so you can roll back.

  1. On the Deployments tab, choose Modify your deployment. In the web container, choose Choose stored image and select :fcj-container.fcj-nginx.<number>.

Choose the stored image

  1. The Image field now shows your stored image. Keep the port 80 and the public endpoint web.

Stored image selected

  1. Scroll down and choose Save and deploy.

Save and deploy

  1. The service shows Deploying with the new image. The old version keeps serving traffic until the new one passes its health check, so there is no downtime.

Deploying version 2

  1. After a few minutes, the status is Running and the container uses your image.

Running

  1. Under Deployment versions, version 2 is Active and version 1 is Inactive. To roll back, open the menu (⋮) of version 1 and deploy it again.

Deployment versions

  1. Open the public domain again, or run the curl command of chapter 2. You see your page Welcome to the Amazon Lightsail Container workshop.

Your page