Skip to content

Simplify adding annotations to the manifest #202

Closed

Description

@rjaegers

Per #201 annotations have been added to the manifest/index file. The way this is done is rather cumbersome at the moment. When docker/build-push-action#958 is solved by means of docker/build-push-action#992, together with docker/metadata-action#351, we can simplify this:

- uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
id: build-and-push
with:
file: .devcontainer/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'merge_group' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=image,${{ steps.annotations.outputs.annotations }}
sbom: true
provenance: true
cache-from: type=gha
cache-to: type=gha,mode=max

to:

- uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
  id: build-and-push
  with:
    file: .devcontainer/Dockerfile
    platforms: linux/amd64,linux/arm64
    push: ${{ github.event_name != 'merge_group' }}
    tags: ${{ steps.meta.outputs.tags }}
    labels: ${{ steps.meta.outputs.labels }}
    annotations: ${{ steps.meta.outputs.labels }}
    sbom: true
    provenance: true
    cache-from: type=gha
    cache-to: type=gha,mode=max

And remove this:

- run: |
set -Eeuo pipefail
ANNOTATIONS=$(echo '${{ steps.meta.outputs.labels }}' | sed 's/org.opencontainers.image./annotation-index.org.opencontainers.image./' | tr '\n' ',')
echo "annotations=${ANNOTATIONS::-1}" >> "$GITHUB_OUTPUT"
id: annotations

Activity

  1. github-actions commented on Nov 10, 2023

    @github-actions
    Contributor

    Thank you for adding your first issue. We will be looking into it as soon as possible.

  2. rjaegers commented on Dec 2, 2023

    @rjaegers
    MemberAuthor

    Closed by #225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions