forked from calebstewart/pwncat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
49 lines (38 loc) · 1.07 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM alpine:latest as builder
# Install python3 and development files
RUN set -eux \
&& apk add --no-cache \
alpine-sdk \
libffi-dev \
linux-headers \
openssl-dev \
python3 \
python3-dev
# Install pip
RUN set -eux \
&& python3 -m ensurepip
# Ensure pip is up to date
RUN set -eux \
&& python3 -m pip install -U pip setuptools wheel
# Copy pwncat source
COPY . /pwncat
# Setup pwncat
RUN set -eux \
&& cd /pwncat \
&& python3 setup.py install
# Cleanup
RUN set -eux \
&& find /usr/lib -type f -name '*.pyc' -print0 | xargs -0 -n1 rm -rf || true \
&& find /usr/lib -type d -name '__pycache__' -print0 | xargs -0 -n1 rm -rf || true
FROM alpine:latest as final
RUN set -eux \
&& apk add --no-cache \
python3 \
&& find /usr/lib -type f -name '*.pyc' -print0 | xargs -0 -n1 rm -rf || true \
&& find /usr/lib -type d -name '__pycache__' -print0 | xargs -0 -n1 rm -rf || true \
&& mkdir /work
COPY --from=builder /usr/bin/pwncat /usr/bin/pwncat
COPY --from=builder /usr/lib/python3.8 /usr/lib/python3.8
# Set working directory
WORKDIR /work
ENTRYPOINT ["/usr/bin/pwncat"]