-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·58 lines (45 loc) · 1.36 KB
/
Dockerfile
File metadata and controls
executable file
·58 lines (45 loc) · 1.36 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# build based on https://hub.docker.com/r/instrumentisto/nmap/
FROM alpine:3.17 as builder
ARG NMAP_VERSION=7.93
# Install dependencies
RUN apk add --update \
ca-certificates \
libpcap \
libgcc libstdc++ \
libssl3
# Compile and install Nmap from sources
# FIXME: upgrade to latest alpine and remove `-k` from cURL
RUN apk add --update --no-cache --virtual .build-deps \
libpcap-dev openssl-dev lua-dev linux-headers \
autoconf g++ libtool make \
curl \
\
&& curl -fL -o /tmp/nmap.tar.bz2 \
https://nmap.org/dist/nmap-${NMAP_VERSION}.tar.bz2 \
&& tar -xjf /tmp/nmap.tar.bz2 -C /tmp \
&& cd /tmp/nmap-${NMAP_VERSION}\
&& ./configure \
--with-openssl=/usr/lib \
--prefix=/usr-nmap \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--without-zenmap \
--without-nmap-update \
--with-liblua=/usr/include \
&& make \
&& make install
FROM python:3.7-alpine3.17
RUN apk add --no-cache \
ca-certificates \
libpcap \
libstdc++ \
libssl3
RUN update-ca-certificates
RUN pip install python-libnmap \
&& rm -rf /root/.cache
COPY --from=builder /usr-nmap /usr
VOLUME /input
VOLUME /output
ADD entrypoint.py /
ENTRYPOINT ["python", "-u", "/entrypoint.py"]