-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
33 lines (23 loc) · 861 Bytes
/
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
FROM golang:alpine
LABEL maintainer "Ilya Milov <[email protected]>"
ENV GO111MODULE=on
RUN apk --update --no-cache add libpcap-dev \
git \
build-base
COPY . /go/src/github.com/ilyaglow/badcapt
RUN cd /go/src/github.com/ilyaglow/badcapt \
&& go mod download \
&& go build -ldflags="-s -w" -a -installsuffix static -o /badcapt cmd/badcapt/badcapt.go
FROM scratch
ADD https://raw.githubusercontent.com/nmap/nmap/master/nmap-services /nmap-services
FROM alpine:latest
RUN apk --update --no-cache add libpcap \
libcap \
&& adduser -D badcapt
COPY --from=0 /badcapt /badcapt
COPY --from=1 /nmap-services /nmap-services
RUN setcap cap_net_raw+eip /badcapt \
&& chown badcapt:badcapt /nmap-services
USER badcapt
ENTRYPOINT ["/badcapt"]
CMD ["-h"]