forked from mushorg/conpot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
36 lines (26 loc) · 981 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.8 AS conpot-builder
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy the app from the host folder (probably a cloned repo) to the container
RUN adduser --disabled-password --gecos "" conpot
COPY --chown=conpot:conpot . /opt/conpot/
# Install Conpot
USER conpot
ENV PATH=$PATH:/home/conpot/.local/bin
RUN pip3 install --user --no-cache-dir /opt/conpot
# Run container
FROM python:3.8-slim
RUN adduser --disabled-password --gecos "" conpot
WORKDIR /home/conpot
COPY --from=conpot-builder --chown=conpot:conpot /home/conpot/.local/ /home/conpot/.local/
# Create directories
RUN mkdir -p /var/log/conpot/ \
&& mkdir -p /data/tftp/ \
&& chown conpot:conpot /var/log/conpot \
&& chown conpot:conpot -R /data
USER conpot
WORKDIR /home/conpot
ENV USER=conpot
ENTRYPOINT ["/home/conpot/.local/bin/conpot"]
CMD ["--template", "default", "--logfile", "/var/log/conpot/conpot.log", "-f", "--temp_dir", "/tmp" ]