I have a github build that pushes images to ECR, but when they get there, they show up as untagged / no way i can see to tell image / platform etc is created. Is this a bug or a mistake my end?
GHA:
name: push
on: [workflow_dispatch]
env:
ECR_REPOSITORY: gha
jobs:
build-image:
name: Build Images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_MGMT_ECR_ID }}
aws-secret-access-key: ${{ secrets.AWS_MGMT_ECR_KEY }}
aws-region: eu-west-2
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up docker buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}
tags: |
type=semver,pattern={{version}},value=1.0.0
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
- name: Docker build
uses: docker/build-push-action@v4
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
And in ECR i then see:
2
Answers
I didn’t use the metadata action. But here is a sample working with ECR:
Just add
provenance: false
in docker/build-push-action@v4