-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Liam Newman <[email protected]>
- Loading branch information
1 parent
7db9a8c
commit a0f8c67
Showing
4 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
ARG ARCH="" | ||
FROM ${ARCH}debian:buster-slim | ||
|
||
RUN \ | ||
apt-get update && apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
gcc \ | ||
netbase \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN set -x \ | ||
&& mkdir -p rootfs/lib \ | ||
&& set -- \ | ||
/etc/nsswitch.conf \ | ||
/etc/ssl/certs/ca-certificates.crt \ | ||
/usr/share/zoneinfo \ | ||
/etc/services \ | ||
/lib/"$(gcc -print-multiarch)"/libpthread.so.* \ | ||
&& while [ "$#" -gt 0 ]; do \ | ||
f="$1"; shift; \ | ||
fn="$(basename "$f")"; \ | ||
if [ -e "rootfs/lib/$fn" ]; then continue; fi; \ | ||
if [ "${f#/lib/}" != "$f" ]; then \ | ||
ln -vL "$f" "rootfs/lib/$fn"; \ | ||
else \ | ||
d="$(dirname $f)" \ | ||
&& mkdir -p "rootfs/${d#/}" \ | ||
&& cp -av "$f" "rootfs/${f#/}"; \ | ||
fi; \ | ||
done | ||
|
||
FROM ${ARCH}alpine:latest as alpine | ||
RUN apk add busybox-static && \ | ||
rm /bin/* && \ | ||
/tmp/busybox --install /bin && \ | ||
mv /tmp/busybox /bin/ | ||
|
||
FROM ${ARCH}busybox:glibc | ||
MAINTAINER The Prometheus Authors <[email protected]> | ||
|
||
# Use the busybox executable from alpine which is generally patched more quickly for vulnerabilities | ||
# Use the busybox.static to avoid dynamic library dependencies. | ||
COPY --from=alpine /bin/busybox.static /tmp/busybox | ||
|
||
RUN rm /bin/* && \ | ||
/tmp/busybox --install /bin && \ | ||
mv /tmp/busybox /bin/ | ||
|
||
COPY --from=0 /rootfs / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,18 +29,7 @@ RUN set -x \ | |
fi; \ | ||
done | ||
|
||
FROM ${ARCH}alpine:latest as alpine | ||
RUN apk add busybox-static | ||
|
||
FROM ${ARCH}busybox:glibc | ||
MAINTAINER The Prometheus Authors <[email protected]> | ||
|
||
# Use the busybox executable from alpine which is generally patched more quickly for vulnerabilities | ||
# Use the busybox.static to avoid dynamic library dependencies. | ||
COPY --from=alpine /bin/busybox.static /tmp/busybox | ||
|
||
RUN rm /bin/* && \ | ||
/tmp/busybox --install /bin && \ | ||
mv /tmp/busybox /bin/ | ||
|
||
COPY --from=0 /rootfs / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,18 +28,7 @@ RUN set -x \ | |
fi; \ | ||
done | ||
|
||
FROM ${ARCH}alpine:latest as alpine | ||
RUN apk add busybox-static | ||
|
||
FROM ${ARCH}busybox:uclibc | ||
MAINTAINER The Prometheus Authors <[email protected]> | ||
|
||
# Use the busybox executable from alpine which is generally patched more quickly for vulnerabilities | ||
# Use the busybox.static to avoid dynamic library dependencies. | ||
COPY --from=alpine /bin/busybox.static /tmp/busybox | ||
|
||
RUN rm /bin/* && \ | ||
/tmp/busybox --install /bin && \ | ||
mv /tmp/busybox /bin/ | ||
|
||
COPY --from=0 /rootfs / |