2020-05-07 06:41:53 -07:00
|
|
|
## builder
|
2025-03-12 00:49:19 +07:00
|
|
|
FROM alpine:3.21 as builder
|
2020-04-17 03:55:57 -07:00
|
|
|
LABEL image="ripe-atlas-builder"
|
|
|
|
ARG GIT_URL=https://github.com/RIPE-NCC/ripe-atlas-software-probe.git
|
|
|
|
|
2025-03-12 00:49:19 +07:00
|
|
|
COPY alpinelinux-fix-sys-reboot.patch /tmp/alpinelinux-fix-sys-reboot.patch
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2025-03-12 00:49:19 +07:00
|
|
|
WORKDIR /
|
|
|
|
|
|
|
|
RUN apk update && \
|
|
|
|
apk upgrade && \
|
|
|
|
apk add git alpine-sdk openssl-dev autoconf automake libtool linux-headers musl-dev psmisc net-tools
|
2025-03-11 13:26:04 +07:00
|
|
|
RUN git clone --recursive "$GIT_URL" /tmp/ripe-atlas-software-probe
|
2022-05-12 01:10:54 -04:00
|
|
|
|
2025-03-11 13:26:04 +07:00
|
|
|
WORKDIR /tmp/ripe-atlas-software-probe
|
2025-04-02 22:52:25 +07:00
|
|
|
# version 5110
|
|
|
|
RUN git checkout 5110
|
2025-03-12 00:49:19 +07:00
|
|
|
|
2025-03-10 22:35:35 +07:00
|
|
|
RUN autoreconf -iv
|
2025-03-11 13:26:04 +07:00
|
|
|
RUN ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --libdir=/usr/lib64 --runstatedir=/run --with-user=ripe-atlas --with-group=ripe-atlas --with-measurement-user=ripe-atlas --disable-systemd --enable-chown --enable-setcap-install
|
2025-03-10 22:35:35 +07:00
|
|
|
RUN make
|
2022-05-12 01:10:54 -04:00
|
|
|
|
|
|
|
## artifacts
|
|
|
|
FROM scratch AS artifacts
|
|
|
|
LABEL image="ripe-atlas-artifacts"
|
|
|
|
|
2025-03-11 13:26:04 +07:00
|
|
|
COPY --from=builder /tmp/ripe-atlas-software-probe /
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2020-05-07 06:41:53 -07:00
|
|
|
## the actual image
|
2025-03-12 00:49:19 +07:00
|
|
|
FROM alpine:3.21
|
2025-03-12 14:12:04 +07:00
|
|
|
LABEL maintainer="c@3qx.nl"
|
2020-05-07 06:41:53 -07:00
|
|
|
LABEL image="ripe-atlas"
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2025-03-11 13:26:04 +07:00
|
|
|
COPY --from=builder /tmp/ripe-atlas-software-probe /tmp/ripe-atlas-software-probe
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2020-07-31 07:04:21 -07:00
|
|
|
ARG ATLAS_UID=101
|
2025-03-12 00:49:19 +07:00
|
|
|
ARG ATLAS_GID=656
|
2020-05-07 06:41:53 -07:00
|
|
|
RUN ln -s /bin/true /bin/systemctl \
|
2025-03-10 22:35:35 +07:00
|
|
|
&& adduser --system --uid $ATLAS_UID ripe-atlas \
|
2025-03-12 00:49:19 +07:00
|
|
|
&& addgroup --system --gid $ATLAS_GID ripe-atlas \
|
|
|
|
&& apk update \
|
|
|
|
&& apk upgrade \
|
|
|
|
&& apk add libcap iproute2 openssh-client procps net-tools tini openssl-dev autoconf automake psmisc alpine-sdk libtool linux-headers bash setpriv
|
2025-03-10 22:35:35 +07:00
|
|
|
WORKDIR /tmp/ripe-atlas-software-probe
|
|
|
|
RUN make install
|
|
|
|
|
|
|
|
# Inprogress
|
2020-04-17 03:55:57 -07:00
|
|
|
|
|
|
|
COPY entrypoint.sh /usr/local/bin
|
|
|
|
RUN chmod +x /usr/local/bin/* \
|
2025-03-11 13:26:04 +07:00
|
|
|
&& rm -rf /tmp/ripe-atlas-software-probe \
|
2025-03-13 10:55:24 +07:00
|
|
|
&& apk del autoconf automake psmisc alpine-sdk libtool linux-headers
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2025-03-11 17:31:28 +07:00
|
|
|
WORKDIR /
|
2025-03-11 13:26:04 +07:00
|
|
|
VOLUME [ "/etc/ripe-atlas", "/run/ripe-atlas/status", "/var/spool/ripe-atlas" ]
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2023-12-16 16:13:30 -05:00
|
|
|
ENTRYPOINT [ "tini", "--", "entrypoint.sh" ]
|
2025-03-11 13:26:04 +07:00
|
|
|
CMD [ "ripe-atlas" ]
|