Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.67 KB

README.md

File metadata and controls

39 lines (28 loc) · 1.67 KB

Docker + buildx + AWS ECR images

Build status Authors link License


Docker image built on top of official Docker image, with the addition of a helper binary to get a login token for AWS ECR.

This image is mostly useful in CI/CD pipelines to build and publish Docker images to AWS ECR, but can easily be used to publish on other registries.

Usage

Login to ECR

The machine on which this command is run must be authenticated to the desired AWS account and have an associated IAM policy granting it permission to obtain the token (see the binary's repository for more information).

aws-ecr-get-login-password | docker login -u AWS --password-stdin "${ECR_REGISTRY}"

Build container

For a multi-architecture image with buildx, run these commands:

docker run --privileged tonistiigi/binfmt --install all
docker context create multi-arch
docker --context multi-arch buildx create --use
docker --context multi-arch buildx build --platform 'linux/amd64,linux/arm64' -t "${IMAGE_NAME}:${IMAGE_TAG}" .