Skip to content

Commit 4b912da

Browse files
authored
Merge pull request #257 from macbre/label-via-action
Dockerfile: labelling happens in the action that builds and publishes an image
2 parents 7f24068 + 48630a3 commit 4b912da

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

.github/workflows/dockerimage.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,14 @@ jobs:
1616
- name: Build the Docker image
1717
env:
1818
# @see https://docs.docker.com/develop/develop-images/build_enhancements/
19-
COMPOSE_DOCKER_CLI_BUILD: "1"
2019
DOCKER_BUILDKIT: "1"
2120
run: |
2221
docker build . \
23-
--cache-from macbre/index-digest:latest \
24-
--build-arg COMMIT_SHA=$(git rev-parse --short HEAD) \
22+
--cache-from ghcr.io/macbre/index-digest:latest \
23+
--build-arg BUILDKIT_INLINE_CACHE=1 \
24+
--build-arg GITHUB_SHA=$(git rev-parse --short HEAD) \
2525
--tag ${{ github.repository }}
26+
2627
docker images
2728
2829
echo "## Image labels:"

Dockerfile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@ RUN apk upgrade \
1616
&& rm -rf /root/.cache \
1717
&& apk del build-deps
1818

19-
ARG COMMIT_SHA="dev"
20-
ENV COMMIT_SHA ${COMMIT_SHA}
21-
22-
# label the image with branch name and commit hash
23-
LABEL maintainer="[email protected]"
24-
LABEL org.opencontainers.image.source="https://github.com/macbre/index-digest"
25-
LABEL org.opencontainers.image.revision="${COMMIT_SHA}"
19+
ARG GITHUB_SHA="dev"
20+
ENV COMMIT_SHA ${GITHUB_SHA}
2621

2722
# install the remaining files
2823
ADD . .

hooks/build

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)