File: Dockerfile

package info (click to toggle)
zmap 4.3.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,628 kB
  • sloc: ansic: 15,033; python: 1,085; yacc: 125; sh: 120; lex: 28; makefile: 4
file content (66 lines) | stat: -rw-r--r-- 1,474 bytes parent folder | download
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
59
60
61
62
63
64
65
66
####
# A Docker container for running zmap
#
# To build, beware of caching and:
#
#   * If you wish to build current main
#
#        docker build -t zmap .
#
#   * If you wish to build a specific commit, git checkout to that specific commit before building
#
# To run CI pre-built images, use:
#
#     docker run -it --rm --net=host ghcr.io/zmap/zmap <zmap args>
####

FROM ubuntu:24.04 as builder

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC

RUN apt-get update \
    && apt-get install -y \
    build-essential \
    cmake \
    libgmp3-dev \
    gengetopt \
    libpcap-dev \
    flex \
    byacc \
    libjson-c-dev \
    libjudy-dev \
    pkg-config \
    libunistring-dev \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/local/src

COPY . .

RUN cd /usr/local/src \
    && mkdir -p /opt/zmap \
    && cmake . -DRESPECT_INSTALL_PREFIX_CONFIG=ON  \
    && cmake --build . --parallel "$(nproc)" \
    && cmake --install . --prefix "/opt/zmap"

FROM ubuntu:24.04

LABEL org.opencontainers.image.source="https://github.com/zmap/zmap"

RUN apt-get update \
    && apt-get install -y \
    libpcap0.8 \
    libjson-c5 \
    libjudydebian1 \
    libgmp10 \
    dumb-init \
    && rm -rf /var/lib/apt/lists/*

COPY --from=builder /opt/zmap /opt/zmap

ENV PATH="/opt/zmap/sbin:${PATH}"

# dumb-init allows us to more easily send signals to zmap,
# for example by allowing ctrl-c of a running container and zmap will stop.
ENTRYPOINT ["dumb-init", "/opt/zmap/sbin/zmap"]