mirror of https://github.com/cowrie/cowrie.git
create dropin.cache at build time (#2414)
* create dropin.cache at build time * set SOURCE_DATE_EPOCH for use in Docker
This commit is contained in:
parent
bd8108cd01
commit
2cefdec289
|
@ -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
|
||||
|
|
|
@ -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)))
|
|
@ -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 <michel@oosterhof.net>"
|
||||
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" ]
|
||||
|
||||
|
|
Loading…
Reference in New Issue