Skip to content

Commit 0178d54

Browse files
committed
MAINTENANCE
- updated alpine to 3.19 - changed user to 65532 to comply with default distroless images - removed risc support as it is quite hard to support for programs like tiny - use precompiled tiny rather than compiling it on my own - set permissions and ownership explicitly on binaries
1 parent cb264c3 commit 0178d54

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

Dockerfile

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,30 @@
11
# syntax = docker/dockerfile:1.5.2
22
# tag needed for riscv64 support
3-
FROM alpine:3.19 AS build-tools
3+
FROM --platform=$BUILDPLATFORM alpine:3.19 AS httpd_git
44

5-
RUN apk add --no-cache gcc musl-dev make perl git cmake curl
5+
RUN apk add --no-cache git
66
WORKDIR /app
77

8-
9-
FROM build-tools AS httpd
10-
118
ARG BUSYBOX_VERSION=1_36_0
129

1310
# https://subscription.packtpub.com/book/hardware-and-creative/9781783289851/1/ch01lvl1sec08/configuring-busybox-simple
1411
RUN git clone --depth 1 https://github.com/mirror/busybox.git .
1512
RUN git fetch origin tag "$BUSYBOX_VERSION" --no-tags
1613
RUN git -c advice.detachedHead=false -c gc.auto=0 checkout "tags/$BUSYBOX_VERSION"
17-
COPY --link ./config .config
14+
15+
16+
FROM alpine:3.19 AS httpd
17+
18+
RUN apk add --no-cache gcc make musl-dev
19+
COPY --link --from=httpd_git /app /app
20+
COPY --link ./config /app/.config
21+
WORKDIR /app
1822
RUN make -s -j4 && make install
1923

2024

21-
FROM build-tools AS tini
25+
FROM --platform=$BUILDPLATFORM alpine:3.19 AS tini
2226

27+
RUN apk add --no-cache curl
2328
ARG TINI_VERSION="v0.19.0"
2429
ARG TARGETPLATFORM
2530
RUN <<EOF
@@ -42,14 +47,15 @@ case "$TARGETPLATFORM" in
4247
*) echo "Unsupported architecture: $TARGETPLATFORM"; exit 1
4348
;;
4449
esac
50+
echo "downloading tiny $TINI_VERSION for arch $TINI_ARCH"
4551
curl -fsSLo /tini "https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini-static-$TINI_ARCH"
4652
EOF
4753

4854

4955
FROM scratch AS squash
5056

51-
COPY --link --from=build-tools /tmp /tmp
52-
COPY --link --from=build-tools /opt /opt
57+
COPY --link --from=httpd_git /tmp /tmp
58+
COPY --link --from=httpd_git /opt /opt
5359
COPY --link --chown=0:0 --chmod=644 <<EOF /etc/group
5460
root:x:0:root
5561
www-data:x:65532:httpd

0 commit comments

Comments
 (0)