Build a Docker image

Use DuploCloud to build and push a Docker image from GitHub Actions

Avoid using capital letters when referencing a DuploCloud construct, such as a Tenant, even when the UI displays the string in all capital letters. Don't specify DEV01, for example; specify dev01. The `TENANT_NAME` may need to be lowercase even though the UI shows it in uppercase.

Build and Push to ECR

This section aims to show you how to build a Docker image and push it to ECR.

It does three things:

  • Logs in to AWS ECR (using just-in-time AWS credentials from DuploCloud)

  • Builds and tags your Docker image, with the tags based on the Git commit SHA and ref.

  • Pushes your Docker image

Example Workflow

Here is an example of a GitHub workflow that builds and pushes a Docker image to ECR.

To use it, ensure the following are configured correctly:

  • DUPLO_HOST environment variable

  • DUPLO_TOKEN environment variable

References

Last updated

Logo

© DuploCloud, Inc. All rights reserved. DuploCloud trademarks used herein are registered trademarks of DuploCloud and affiliates