From 7f4cdc99efb349e0d617e12f61599af20bb26b93 Mon Sep 17 00:00:00 2001 From: innovaker <66737976+innovaker@users.noreply.github.com> Date: Sun, 9 May 2021 20:50:17 +0100 Subject: [PATCH] refactor: move OCI `image.source` LABEL out of Dockerfile Defining the LABEL via an ARG at the top of the Dockerfile prevents other GitHub repositories (or local Docker users) from leveraging otherwise identical cache layers. PR: #18 --- .github/workflows/containers.yml | 3 ++- Dockerfile | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/containers.yml b/.github/workflows/containers.yml index 39b89ec..078e92a 100644 --- a/.github/workflows/containers.yml +++ b/.github/workflows/containers.yml @@ -83,7 +83,8 @@ jobs: ZEPHYR_VERSION=${{ env.zephyr-version }} ARCHITECTURE=${{ matrix.architecture }} ZEPHYR_SDK_VERSION=${{ env.zephyr-sdk-version }} - REPOSITORY_URL=${{ github.server_url }}/${{ github.repository }} + labels: | + org.opencontainers.image.source=${{ github.server_url }}/${{ github.repository }} tags: | docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ steps.vars.outputs.candidate-tag }} cache-from: type=registry,ref=docker.io/${{ secrets.DOCKER_HUB_NAMESPACE }}/${{ steps.vars.outputs.cache-from }},push=false diff --git a/Dockerfile b/Dockerfile index 062e0b3..8b072e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,9 +4,6 @@ CMD ["/bin/bash"] ENV DEBIAN_FRONTEND=noninteractive -ARG REPOSITORY_URL=https://github.com/innovaker/zmk-docker -LABEL org.opencontainers.image.source ${REPOSITORY_URL} - ARG ZEPHYR_VERSION ENV ZEPHYR_VERSION=${ZEPHYR_VERSION} RUN \