2020-05-07 06:41:53 -07:00
|
|
|
## builder
|
2025-02-16 12:58:36 +07:00
|
|
|
FROM --platform=$BUILDPLATFORM debian:12-slim as builder
|
2020-04-17 03:55:57 -07:00
|
|
|
LABEL image="ripe-atlas-builder"
|
2022-05-12 01:10:54 -04:00
|
|
|
ARG BUILDPLATFORM
|
|
|
|
ARG TARGETPLATFORM
|
2020-04-17 03:55:57 -07:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
ARG GIT_URL=https://github.com/RIPE-NCC/ripe-atlas-software-probe.git
|
|
|
|
|
|
|
|
WORKDIR /root
|
|
|
|
|
2022-05-12 01:10:54 -04:00
|
|
|
RUN if [ "$BUILDPLATFORM" != "$TARGETPLATFORM" ] ; then \
|
2025-02-16 12:58:36 +07:00
|
|
|
apt-get update -y \
|
2025-02-16 12:59:41 +07:00
|
|
|
apt-get install -y git build-essential debhelper libssl-dev autotools-dev psmisc net-tools \
|
2025-02-16 12:58:36 +07:00
|
|
|
fi
|
2022-05-12 01:10:54 -04:00
|
|
|
|
2020-04-17 03:55:57 -07:00
|
|
|
RUN git clone --recursive "$GIT_URL"
|
2022-05-12 01:10:54 -04:00
|
|
|
|
2024-08-23 10:55:58 +08:00
|
|
|
WORKDIR /root/ripe-atlas-software-probe
|
2025-02-16 12:49:52 +07:00
|
|
|
# version 5100
|
|
|
|
RUN git checkout 5100
|
|
|
|
RUN dpkg-buildpackage -b -us -uc
|
2024-08-23 10:55:58 +08:00
|
|
|
WORKDIR /root
|
|
|
|
|
2022-05-12 01:10:54 -04:00
|
|
|
|
|
|
|
## artifacts
|
|
|
|
FROM scratch AS artifacts
|
|
|
|
LABEL image="ripe-atlas-artifacts"
|
|
|
|
|
2025-02-16 12:49:52 +07:00
|
|
|
COPY --from=builder /root/ripe-atlas-probe*.deb /
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2020-05-07 06:41:53 -07:00
|
|
|
## the actual image
|
2025-02-16 12:49:52 +07:00
|
|
|
FROM debian:12-slim
|
2020-04-17 03:55:57 -07:00
|
|
|
LABEL maintainer="dockerhub@public.swineson.me"
|
2020-05-07 06:41:53 -07:00
|
|
|
LABEL image="ripe-atlas"
|
2020-04-17 03:55:57 -07:00
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2025-02-16 12:49:52 +07:00
|
|
|
COPY --from=builder /root/ripe-atlas-probe*.deb /tmp
|
2020-04-17 03:55:57 -07:00
|
|
|
|
2020-07-31 07:04:21 -07:00
|
|
|
ARG ATLAS_UID=101
|
|
|
|
ARG ATLAS_GID=999
|
2020-05-07 06:41:53 -07:00
|
|
|
RUN ln -s /bin/true /bin/systemctl \
|
2020-07-31 07:04:21 -07:00
|
|
|
&& adduser --system --uid $ATLAS_UID atlas \
|
|
|
|
&& groupadd --force --system --gid $ATLAS_GID atlas \
|
|
|
|
&& usermod -aG atlas atlas \
|
2020-05-07 06:41:53 -07:00
|
|
|
&& apt-get update -y \
|
2023-12-16 16:13:30 -05:00
|
|
|
&& apt-get install -y libcap2-bin iproute2 openssh-client procps net-tools tini \
|
2025-02-16 12:49:52 +07:00
|
|
|
&& dpkg -i /tmp/ripe-atlas-probe*.deb \
|
2020-04-17 03:55:57 -07:00
|
|
|
&& apt-get install -fy \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2025-02-16 12:49:52 +07:00
|
|
|
&& rm -f /tmp/ripe-atlas-probe*.deb \
|
2020-05-07 06:41:53 -07:00
|
|
|
&& ln -s /usr/local/atlas/bin/ATLAS /usr/local/bin/atlas
|
2020-04-17 03:55:57 -07:00
|
|
|
|
|
|
|
COPY entrypoint.sh /usr/local/bin
|
|
|
|
RUN chmod +x /usr/local/bin/* \
|
|
|
|
&& chown -R atlas:atlas /var/atlas-probe \
|
|
|
|
&& mkdir -p /var/atlasdata \
|
|
|
|
&& chown -R atlas:atlas /var/atlasdata \
|
|
|
|
&& chmod 777 /var/atlasdata
|
|
|
|
|
|
|
|
WORKDIR /var/atlas-probe
|
|
|
|
VOLUME [ "/var/atlas-probe/etc", "/var/atlas-probe/status" ]
|
|
|
|
|
2023-12-16 16:13:30 -05:00
|
|
|
ENTRYPOINT [ "tini", "--", "entrypoint.sh" ]
|
2020-04-17 03:55:57 -07:00
|
|
|
CMD [ "atlas" ]
|