Skip to content

Commit d3b5018

Browse files
move to separate builder and runtime
1 parent 31076b3 commit d3b5018

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

Dockerfile

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# SPDX-License-Identifier: CC0-1.0
66

7-
FROM ubuntu:24.04
7+
FROM ubuntu:24.04 AS builder
88

99
ARG DEBIAN_FRONTEND=noninteractive
1010

@@ -54,26 +54,26 @@ RUN mkdir -p /code/build && \
5454
make && \
5555
make install && \
5656
chown -R dionaea:dionaea /opt/dionaea/var && \
57-
cp /code/docker/entrypoint.sh /usr/local/sbin/entrypoint.sh && \
57+
cp /code/docker/entrypoint.sh /opt/dionaea/entrypoint.sh && \
5858
mkdir -p /opt/dionaea/template && \
5959
(cd /opt/dionaea && mv var/lib template/ && mv var/log template/ && mv etc template/)
6060

61-
# Remove dev packages
62-
RUN apt-get purge -y \
63-
build-essential \
64-
cmake \
65-
cython3 \
66-
libcurl4-openssl-dev \
67-
libev-dev \
68-
libglib2.0-dev \
69-
libnetfilter-queue-dev \
70-
libpcap-dev \
71-
libssl-dev \
72-
libtool \
73-
libudns-dev \
74-
python3-dev
7561

76-
# Install required packages
62+
FROM ubuntu:24.04 AS runtime
63+
64+
ARG DEBIAN_FRONTEND=noninteractive
65+
66+
ENV DIONAEA_GROUP=dionaea \
67+
DIONAEA_USER=dionaea \
68+
DIONAEA_HOME=/opt/dionaea
69+
70+
ENV LC_ALL=C.UTF-8 \
71+
LANG=C.UTF-8 \
72+
LANGUAGE=C.UTF-8
73+
74+
RUN groupadd -r ${DIONAEA_GROUP} && \
75+
useradd -r -d ${DIONAEA_HOME} -m -g ${DIONAEA_GROUP} ${DIONAEA_USER}
76+
7777
RUN apt-get -qq install -y \
7878
-o APT::Install-Suggests=false \
7979
-o APT::Install-Recommends=false \
@@ -88,6 +88,8 @@ RUN apt-get -qq install -y \
8888
libudns0 && \
8989
apt-get autoremove --purge -y && \
9090
apt-get clean && \
91-
rm -rf /code/ /var/lib/apt/lists/* /tmp/* /var/tmp/*
91+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
92+
93+
COPY --from=builder --chown=${DIONAEA_USER}:${DIONAEA_GROUP} ${DIONAEA_HOME} ${DIONAEA_HOME}
9294

93-
ENTRYPOINT ["/usr/local/sbin/entrypoint.sh"]
95+
ENTRYPOINT ["/opt/dioanea/entrypoint.sh"]

0 commit comments

Comments
 (0)