Skip to content

Commit

Permalink
cleanup labels in Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdbd committed Oct 10, 2024
1 parent ae4d659 commit b2f2e36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ jobs:
APP_NAME=${{env.APP_NAME }}
APP_VERSION=${{env.APP_VERSION }}
BB_VERSION=1.4.192
CREATED_DATE=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.created'] }}
JSOUP_POD_VERSION=0.4.0
LICENSE=MIT
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down
13 changes: 7 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ RUN if [ -z "${CREATED_DATE}" ] ; then echo "CREATED_DATE not set!" ; exit 1; fi
ARG JSOUP_POD_VERSION
RUN if [ -z "${JSOUP_POD_VERSION}" ] ; then echo "JSOUP_POD_VERSION not set!" ; exit 1; fi

ARG LICENSE=MIT
RUN if [ -z "${LICENSE}" ] ; then echo "LICENSE not set!" ; exit 1; fi

ARG NON_ROOT_USER=zaraki
RUN if [ -z "${NON_ROOT_USER}" ] ; then echo "NON_ROOT_USER not set!" ; exit 1; fi

Expand Down Expand Up @@ -106,15 +109,13 @@ RUN bb -e "(require '[babashka.pods :as pods]) \
# mv $JSOUP_POD_BB_PATH $JSOUP_POD_PATH && \
# rm -rf "/home/${NON_ROOT_USER}/.babashka"

# When the image is built on GitHub Actions, additional labels are extracted by
# docker-metadata-action and written to the container image by build-and-push-docker-images.
# https://github.com/opencontainers/image-spec/blob/main/annotations.md
LABEL org.opencontainers.image.created=${CREATED_DATE}
LABEL org.opencontainers.image.description="CLI to download videos and slides from FOSDEM websites"
# Not sure why, but docker-metadata-action can't manage to extract the license.
# https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/
LABEL org.opencontainers.image.licenses="MIT"
# This is required when pushing the container image from a computer to GitHub's Container Registry.
LABEL org.opencontainers.image.source=https://github.com/jackdbd/fosdem-dl
LABEL org.opencontainers.image.title=fosdem-dl
LABEL org.opencontainers.image.url=https://github.com/jackdbd/fosdem-dl
LABEL org.opencontainers.image.licenses=${LICENSE}

ENTRYPOINT ["bb", "fosdem-dl.jar"]
CMD ["help"]
Expand Down

0 comments on commit b2f2e36

Please sign in to comment.