2020-07-18 15:08:43 +02:00
|
|
|
FROM alpine:latest as builder
|
2020-07-17 08:48:29 +02:00
|
|
|
|
|
|
|
# Install python3 and development files
|
2020-07-18 15:08:43 +02:00
|
|
|
RUN set -eux \
|
|
|
|
&& apk add --no-cache \
|
|
|
|
alpine-sdk \
|
|
|
|
libffi-dev \
|
|
|
|
linux-headers \
|
|
|
|
openssl-dev \
|
|
|
|
python3 \
|
2021-06-14 15:01:19 +02:00
|
|
|
python3-dev \
|
|
|
|
musl-dev \
|
|
|
|
cargo
|
2020-07-17 08:48:29 +02:00
|
|
|
|
|
|
|
# Install pip
|
2020-07-18 15:08:43 +02:00
|
|
|
RUN set -eux \
|
|
|
|
&& python3 -m ensurepip
|
2020-07-17 08:48:29 +02:00
|
|
|
|
2020-09-13 20:23:32 +02:00
|
|
|
# Ensure pip is up to date
|
|
|
|
RUN set -eux \
|
2021-06-14 15:01:19 +02:00
|
|
|
&& python3 -m pip install -U pip setuptools wheel setuptools_rust
|
2020-09-13 20:23:32 +02:00
|
|
|
|
2020-07-17 08:48:29 +02:00
|
|
|
# Copy pwncat source
|
|
|
|
COPY . /pwncat
|
|
|
|
|
|
|
|
# Setup pwncat
|
2020-07-18 15:08:43 +02:00
|
|
|
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 \
|
2021-02-08 23:13:08 +01:00
|
|
|
python3 libstdc++ \
|
2020-07-18 15:08:43 +02:00
|
|
|
&& 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
|
2020-07-17 08:48:29 +02:00
|
|
|
|
2021-06-14 15:01:19 +02:00
|
|
|
RUN python3 -m pwncat --download-plugins
|
|
|
|
|
2020-07-17 08:48:29 +02:00
|
|
|
# Set working directory
|
|
|
|
WORKDIR /work
|
|
|
|
ENTRYPOINT ["/usr/bin/pwncat"]
|