Skip to content

Instantly share code, notes, and snippets.

@11philip22
Created February 5, 2020 08:16
Show Gist options
  • Save 11philip22/913020011f5d836afb839b4cbcad0e49 to your computer and use it in GitHub Desktop.
Save 11philip22/913020011f5d836afb839b4cbcad0e49 to your computer and use it in GitHub Desktop.
FROM ubuntu:19.10 as build-env
RUN sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
RUN apt-get update
RUN apt-get install wget -y \
&& apt-get build-dep nmap -y
RUN wget https://nmap.org/dist/nmap-7.80.tar.bz2 \
&& bzip2 -cd nmap-7.80.tar.bz2 | tar xvf - \
&& cd nmap-7.80 \
&& ./configure \
&& make
# FROM scratch
FROM ubuntu:19.10
COPY --from=build-env /nmap-7.80/ncat/ncat /usr/local/bin/ncat
COPY --from=build-env /usr/lib/x86_64-linux-gnu/libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so.1.1
COPY --from=build-env /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so.1.
COPY --from=build-env /usr/lib/x86_64-linux-gnu/libpcap.so.0.8 /usr/lib/x86_64-linux-gnu/libpcap.so.0.8
COPY --from=build-env /usr/lib/x86_64-linux-gnu/liblua5.3.so /usr/lib/x86_64-linux-gnu/liblua5.3.so
COPY --from=build-env /usr/lib/x86_64-linux-gnu/libc.so /usr/lib/x86_64-linux-gnu/libc.so
# ENTRYPOINT ["/usr/local/bin/ncat"]
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment