diff --git a/README.md b/README.md index 76bde8c..becf64c 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,13 @@ The following files are added (taken from Debian) to fix some common issues: - `/etc/services` : for named ports resolution - `/lib/x86_64-linux-gnu/libpthread.so.0` : common required lib for project binaries that cannot be statically built. +### prom/busybox:alpine : musl-libc + +Based on the official `alpine:latest` base image. + +The `busybox` executable is replaced by the [statically linked busybox](https://pkgs.alpinelinux.org/package/v3.16/main/x86_64/busybox-static) from `alpine:latest`. +The Alpine project provides far more timely security patches to `busybox` that the official `busybox` release. + ## Build Docker images locally ``` diff --git a/alpine/Dockerfile b/alpine/Dockerfile new file mode 100644 index 0000000..270a90f --- /dev/null +++ b/alpine/Dockerfile @@ -0,0 +1,27 @@ +ARG ARCH="" +FROM ${ARCH}alpine:latest as alpine + +RUN apk upgrade -U && \ + apk add tzdata ca-certificates + +# Use the busybox.static to avoid dynamic library dependencies. +RUN apk add busybox-static && \ + mv /bin/busybox.static /bin/busybox && \ + /bin/busybox --install -s /bin + +# remove extra package +RUN apk del libc-utils + +# remove apk files and directories +RUN apk del apk-tools && \ + find / -name apk -prune -exec rm -rf {} ";" + + +# remove extraneous folders +RUN rm -rf media mnt opt run srv + +FROM scratch +MAINTAINER The Prometheus Authors + +COPY --from=alpine / / +