Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chialab/docker-buildx-ecr
A Docker image shipped with tools to build multi-arch images with buildx and authenticate against AWS ECR.
https://github.com/chialab/docker-buildx-ecr
Last synced: about 2 months ago
JSON representation
A Docker image shipped with tools to build multi-arch images with buildx and authenticate against AWS ECR.
- Host: GitHub
- URL: https://github.com/chialab/docker-buildx-ecr
- Owner: chialab
- License: mit
- Created: 2021-04-08T15:52:44.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T14:42:42.000Z (9 months ago)
- Last Synced: 2024-03-27T15:31:47.080Z (9 months ago)
- Language: Dockerfile
- Size: 37.1 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Docker + buildx + AWS ECR images---
Docker image built on top of [official Docker image](https://hub.docker.com/_/docker),
with the addition of a [helper binary](https://github.com/chialab/aws-ecr-get-login-password) 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).```shell
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:
```shell
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}" .
```