-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (46 loc) · 1.29 KB
/
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
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
# export BUILDKIT_PROGRESS=plain
# docker build -t probe . && docker run --rm -it probe
FROM --platform=$BUILDPLATFORM alpine:latest AS builder
RUN <<EOF
adduser -D -H rasp rasp
apk add --upgrade --no-cache \
autoconf \
automake \
g++ \
gcc \
git \
libcap \
libtool \
linux-headers \
make \
openssl-dev
git clone --recursive https://github.com/RIPE-NCC/ripe-atlas-software-probe.git /tmp/rasp
cd /tmp/rasp
# alpine 3.21 with gcc14 needs this to work
export CFLAGS="-Wno-implicit-function-declaration"
autoreconf -iv
./configure \
--prefix=/rasp \
--with-user=rasp \
--with-group=rasp \
--disable-systemd
# FIX: make tries to chown this file, but it doesnt exist yet
mkdir -p /rasp/etc/ripe-atlas
touch /rasp/etc/ripe-atlas/mode
make install
echo "RXTXRPT=yes" > /rasp/etc/ripe-atlas/config.txt
EOF
FROM --platform=$BUILDPLATFORM alpine:latest
RUN <<EOF
adduser -D -H rasp rasp
apk add --upgrade --no-cache \
net-tools \
openssh-client
EOF
COPY --from=builder --chown=rasp:rasp /rasp /rasp
RUN <<EOF
echo "Alpine Linux: $(cat /etc/alpine-release)" > /rasp/version
echo "RIPE Atlas Software Probe: $(cat /rasp/share/ripe-atlas/FIRMWARE_APPS_VERSION)" >> /rasp/version
EOF
USER rasp
CMD ["sh", "-c", "cat /rasp/version; /rasp/sbin/ripe-atlas"]