diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f4a1df29..e443ff8e 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -41,6 +41,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: set SOURCE_DATE_EPOCH + run: echo "SOURCE_DATE_EPOCH=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV + # Add support for more platforms with QEMU (optional) # https://github.com/docker/setup-qemu-action - name: Set up QEMU diff --git a/bin/regen-dropin.cache b/bin/regen-dropin.cache new file mode 100755 index 00000000..e6ff5927 --- /dev/null +++ b/bin/regen-dropin.cache @@ -0,0 +1,4 @@ +#!/usr/bin/env python +# This is run by packaging tools to update `dropin.cache` to keep track of Twisted's plugin cache +from twisted.plugin import IPlugin, getPlugins +print(list(getPlugins(IPlugin))) diff --git a/docker/Dockerfile b/docker/Dockerfile index a1804215..89335365 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -3,7 +3,7 @@ # `runtime` is stripped down. ARG ARCH= -ARG BUILD_DATE +ARG SOURCE_DATE_EPOCH ARG TAG FROM ${ARCH}debian:bookworm-slim AS builder @@ -63,7 +63,6 @@ COPY --chown=${COWRIE_USER}:${COWRIE_GROUP} . ${COWRIE_HOME}/cowrie-git FROM gcr.io/distroless/python3-debian12 AS runtime #FROM gcr.io/distroless/python3-debian12:debug AS runtime -LABEL org.opencontainers.image.created=${BUILD_DATE} LABEL org.opencontainers.image.authors="Michel Oosterhof " LABEL org.opencontainers.image.url="https://cowrie.org/" LABEL org.opencontainers.image.documentation="https://cowrie.readthedocs.io" @@ -114,6 +113,8 @@ ENV PATH=${COWRIE_HOME}/cowrie-env/bin:${PATH} ENV PYTHONPATH=${COWRIE_HOME}/cowrie-git/src ENV PYTHONUNBUFFERED=1 +RUN [ "python3", "/cowrie/cowrie-git/bin/regen-dropin.cache" ] + ENTRYPOINT [ "/cowrie/cowrie-env/bin/python3" ] CMD [ "/cowrie/cowrie-env/bin/twistd", "-n", "--umask=0022", "--pidfile=", "cowrie" ]