Skip to content

Commit 1b620c0

Browse files
authored
Merge pull request Pennyw0rth#735 from kaisersource/patch-1
Image size improvements and pinned Netexec version
2 parents b0263cb + 0f6f6ad commit 1b620c0

1 file changed

Lines changed: 36 additions & 13 deletions

File tree

Dockerfile

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,45 @@
1-
FROM python:3.11-slim
2-
1+
FROM python:3.13-slim-bookworm AS builder
32
ENV LANG=C.UTF-8
43
ENV LC_ALL=C.UTF-8
54
ENV PIP_NO_CACHE_DIR=off
65

76
WORKDIR /usr/src/netexec
87

9-
RUN apt-get update && \
10-
apt-get install -y libffi-dev libxml2-dev libxslt-dev libssl-dev openssl autoconf g++ python3-dev curl git
11-
RUN apt-get update
12-
# Get Rust
13-
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
14-
# Add .cargo/bin to PATH
8+
RUN apt update && \
9+
apt install -y --no-install-recommends \
10+
libffi-dev \
11+
libxml2-dev \
12+
libxslt-dev \
13+
libssl-dev \
14+
openssl \
15+
autoconf \
16+
g++ \
17+
python3-dev \
18+
curl \
19+
git \
20+
unzip \
21+
&& apt clean && rm -rf /var/lib/apt/lists/*
22+
23+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y --default-toolchain stable
1524
ENV PATH="/root/.cargo/bin:${PATH}"
16-
# Check cargo is visible
17-
RUN cargo --help
1825

19-
COPY . .
20-
RUN pip install .
26+
RUN git clone https://github.com/Pennyw0rth/NetExec.git . \
27+
&& pip install .
28+
29+
FROM python:3.13-slim-bookworm
30+
31+
ENV LANG=C.UTF-8
32+
ENV LC_ALL=C.UTF-8
33+
ENV PIP_NO_CACHE_DIR=off
34+
35+
WORKDIR /usr/src/netexec
36+
37+
COPY --from=builder /usr/local/lib/python3.13/site-packages /usr/local/lib/python3.13/site-packages
38+
COPY --from=builder /usr/local/bin /usr/local/bin
39+
40+
RUN apt update && \
41+
apt install -y --no-install-recommends \
42+
openssl \
43+
&& apt clean && rm -rf /var/lib/apt/lists/*
2144

22-
ENTRYPOINT [ "nxc" ]
45+
ENTRYPOINT ["nxc"]

0 commit comments

Comments
 (0)