Skip to content

Commit

Permalink
Build from scratch
Browse files Browse the repository at this point in the history
Signed-off-by: Liam Newman <[email protected]>
  • Loading branch information
liam-verta committed Dec 15, 2022
1 parent 9b33bd6 commit f092044
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 59 deletions.
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,12 @@ 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-glibc : glibc
### prom/busybox:alpine : musl-libc

Based on the official `busybox:glibc` base image.
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. No other parts of Alpine are needed or used in this image.

The following files are added (taken from Debian) to fix some common issues:

- `/etc/ssl/certs/ca-certificates.crt` : for HTTPS support
- `/usr/share/zoneinfo` : for timezones
- `/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.
The Alpine project provides far more timely security patches to `busybox` that the official `busybox` release.

## Build Docker images locally

Expand Down
49 changes: 0 additions & 49 deletions alpine-glibc/Dockerfile

This file was deleted.

25 changes: 25 additions & 0 deletions alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ARG ARCH=""
FROM ${ARCH}alpine:latest as alpine

RUN apk upgrade -U && \
apk add tzdata ca-certificates busybox-static

# 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 {} ";"

# Use the busybox.static to avoid dynamic library dependencies.
RUN mv /bin/busybox.static /bin/busybox && \
/bin/busybox --install -s /bin

# remove extraneous folders
RUN rm -rf media mnt opt run srv

FROM scratch
MAINTAINER The Prometheus Authors <[email protected]>

COPY --from=alpine / /

0 comments on commit f092044

Please sign in to comment.