-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.nmap-7.90
More file actions
40 lines (37 loc) · 1.16 KB
/
Dockerfile.nmap-7.90
File metadata and controls
40 lines (37 loc) · 1.16 KB
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
ARG MUSL_TARGET=x86_64-linux-musl
FROM pcre-8.45-${MUSL_TARGET} AS pcre
FROM zlib-1.2.11-${MUSL_TARGET} AS zlib
FROM libpcap-1.10.1-${MUSL_TARGET} AS libpcap
FROM openssl-1.1.1k-${MUSL_TARGET} AS openssl
FROM musl-cross-make-${MUSL_TARGET}
ARG MUSL_TARGET
COPY --from=pcre /output /output
COPY --from=zlib /output /output
COPY --from=libpcap /output /output
COPY --from=openssl /output /output
WORKDIR /build
RUN download https://nmap.org/dist/nmap-7.92.tgz source.tar.gz 064183ea642dc4c12b1ab3b5358ce1cef7d2e7e11ffa2849f16d339f5b717117 && tar xf source.tar.gz
RUN export PATH=/build/cross/bin:$PATH && \
cd nmap-* && \
CC="${MUSL_TARGET}-gcc -static" \
CXX="${MUSL_TARGET}-g++ -static -static-libstdc++" \
CFLAGS="-frandom-seed=pulse -I/output/include" \
LDFLAGS="-L/output/lib" \
./configure \
--enable-shared=no \
--enable-static=yes \
--prefix=/output \
--with-pcap=linux \
--without-ncat \
--without-nping \
--without-ndiff \
--without-nmap-update \
--without-zenmap \
--with-openssl=/output \
--with-libz=/output \
--with-libpcre=/output \
--host=$($MUSL_TARGET-gcc -dumpmachine) && \
make -j$(nproc) static && \
make install && \
$MUSL_TARGET-strip /output/bin/nmap
CMD bash