Add opencontainers labels to docker images

This commit is contained in:
JustArchi 2021-01-02 18:33:16 +01:00
parent bf21280cf7
commit 71f3dd5e5c
5 changed files with 38 additions and 2 deletions

View file

@ -33,6 +33,8 @@ jobs:
run: |
set -eu
echo "FIXED_TAG=$(echo ${{ github.ref }} | cut -d '/' -f 3)" >> "$GITHUB_ENV"
echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV"
echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
@ -42,6 +44,10 @@ jobs:
file: Dockerfile.Service
platforms: linux/amd64,linux/arm,linux/arm64
build-args: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
labels: |
org.opencontainers.image.created=${{ env.DATE_ISO8601 }}
org.opencontainers.image.version=${{ env.FIXED_TAG }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
${{ env.DH_REPOSITORY }}:${{ env.TAG }}

View file

@ -39,6 +39,7 @@ jobs:
run: |
set -eu
echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV"
echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
@ -47,6 +48,10 @@ jobs:
with:
platforms: linux/amd64,linux/arm,linux/arm64
build-args: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
labels: |
org.opencontainers.image.created=${{ env.DATE_ISO8601 }}
org.opencontainers.image.version=${{ github.sha }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
${{ env.DH_REPOSITORY }}:${{ env.TAG }}

View file

@ -35,6 +35,7 @@ jobs:
set -eu
echo "FIXED_TAG=$(echo ${{ github.ref }} | cut -d '/' -f 3)" >> "$GITHUB_ENV"
echo "DATE_ISO8601=$(date --iso-8601=seconds --utc)" >> "$GITHUB_ENV"
echo "GHCR_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
echo "DH_REPOSITORY=$(echo ${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_ENV"
@ -43,6 +44,10 @@ jobs:
with:
platforms: linux/amd64,linux/arm,linux/arm64
build-args: STEAM_TOKEN_DUMPER_TOKEN=${{ secrets.STEAM_TOKEN_DUMPER_TOKEN }}
labels: |
org.opencontainers.image.created=${{ env.DATE_ISO8601 }}
org.opencontainers.image.version=${{ env.FIXED_TAG }}
org.opencontainers.image.revision=${{ github.sha }}
tags: |
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.TAG }}
ghcr.io/${{ env.GHCR_REPOSITORY }}:${{ env.FIXED_TAG }}

View file

@ -48,7 +48,17 @@ FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/aspnet:5.0${IMAGESUFFIX
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_NOLOGO 1
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>" \
org.opencontainers.image.authors="JustArchi <JustArchi@JustArchi.net>" \
org.opencontainers.image.url="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Docker" \
org.opencontainers.image.documentation="https://github.com/JustArchiNET/ArchiSteamFarm/wiki" \
org.opencontainers.image.source="https://github.com/JustArchiNET/ArchiSteamFarm" \
org.opencontainers.image.vendor="JustArchiNET" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="ArchiSteamFarm" \
org.opencontainers.image.description="C# application with primary purpose of idling Steam cards from multiple accounts simultaneously"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .

View file

@ -48,7 +48,17 @@ FROM --platform=$TARGETPLATFORM mcr.microsoft.com/dotnet/runtime-deps:5.0${IMAGE
ENV ASPNETCORE_URLS=
ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
ENV DOTNET_NOLOGO 1
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>"
LABEL maintainer="JustArchi <JustArchi@JustArchi.net>" \
org.opencontainers.image.authors="JustArchi <JustArchi@JustArchi.net>" \
org.opencontainers.image.url="https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Docker" \
org.opencontainers.image.documentation="https://github.com/JustArchiNET/ArchiSteamFarm/wiki" \
org.opencontainers.image.source="https://github.com/JustArchiNET/ArchiSteamFarm" \
org.opencontainers.image.vendor="JustArchiNET" \
org.opencontainers.image.licenses="Apache-2.0" \
org.opencontainers.image.title="ArchiSteamFarm" \
org.opencontainers.image.description="C# application with primary purpose of idling Steam cards from multiple accounts simultaneously"
EXPOSE 1242
WORKDIR /app
COPY --from=build-dotnet /app/out/result .