Add all org.opencontainers.image.xxx labels using --label instead of LABEL

This commit is contained in:
Leonard Jonathan Oh 2023-03-13 23:41:43 +00:00
parent 7ac893b179
commit c117d8baa1
2 changed files with 5 additions and 3 deletions

View file

@ -23,9 +23,6 @@ RUN set -eux; \
FROM php:8.1-fpm-alpine AS final FROM php:8.1-fpm-alpine AS final
LABEL org.label-schema.description="SnappyMail webmail client image using nginx, php-fpm on Alpine" LABEL org.label-schema.description="SnappyMail webmail client image using nginx, php-fpm on Alpine"
LABEL org.opencontainers.image.source=https://github.com/the-djmaze/snappymail
LABEL org.opencontainers.image.description="SnappyMail"
LABEL org.opencontainers.image.licenses="AGPL v3.0"
# Install dependencies such as nginx # Install dependencies such as nginx
RUN apk add --no-cache ca-certificates nginx supervisor bash RUN apk add --no-cache ca-certificates nginx supervisor bash

View file

@ -42,6 +42,10 @@ jobs:
type=ref,suffix=-{{sha}},event=branch type=ref,suffix=-{{sha}},event=branch
type=ref,event=tag type=ref,event=tag
type=ref,suffix=-{{sha}},event=tag type=ref,suffix=-{{sha}},event=tag
# The rest of the org.opencontainers.image.xxx labels are dynamically generated
labels: |
org.opencontainers.image.description=SnappyMail
org.opencontainers.image.licenses=AGPLv3
# See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache # See: https://github.com/docker/build-push-action/blob/v2.6.1/docs/advanced/cache.md#github-cache
- name: Set up QEMU - name: Set up QEMU
@ -83,6 +87,7 @@ jobs:
platforms: linux/386,linux/amd64 platforms: linux/386,linux/amd64
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max