Fossil SCM

Adding the BusyBox tarball to the container image with an ADD command rather than wget to avoid triggering GitHub throttling. Unlike the Fossil repo URL, it has a version number baked into it, so it's safe to give it over to Docker's caching behavior.

wyoung 2022-08-15 15:32 trunk
Commit d06d7c464e8deba651afabb61f800ff3d225dbc34e50884941e65b56d2453710
1 file changed +4 -3
+4 -3
--- Dockerfile
+++ Dockerfile
@@ -1,29 +1,30 @@
11
# STAGE 1: Build a static Fossil binary atop Alpine Linux
22
33
# Avoid the temptation to swap the wget call below out for an ADD URL
4
-# directive. The URL is fixed for a given release tag, which triggers
4
+# directive. That URL is fixed for a given release tag, which triggers
55
# Docker's caching behavior, causing it to reuse that version as long
66
# as it remains in the cache. We prefer to rely on the caching of the
77
# server instance on fossil-scm.org, which will keep these trunk
88
# tarballs around until the next trunk commit.
99
1010
FROM alpine:latest AS builder
1111
COPY tools/busybox-config /tmp/bbx/.config
1212
ENV BBXVER "1_35_0"
1313
ENV BBXURL "https://github.com/mirror/busybox/archive/refs/tags/${BBXVER}.tar.gz"
14
+ADD $BBXURL /tmp
1415
WORKDIR /tmp
1516
RUN apk update \
1617
&& apk upgrade --no-cache \
1718
&& apk add --no-cache \
1819
gcc make \
1920
linux-headers musl-dev \
2021
openssl-dev openssl-libs-static \
2122
zlib-dev zlib-static \
22
- && wget -O - ${BBXURL} | tar --strip-components=1 -C bbx -xz \
23
- && ( cd bbx; make -j ) \
23
+ && tar --strip-components=1 -C bbx -xzf ${BBXVER}.tar.gz \
2424
&& wget -O - https://fossil-scm.org/home/tarball/src | tar -xz \
25
+ && ( cd bbx; make -j ) \
2526
&& src/configure --static CFLAGS='-Os -s' \
2627
&& make -j
2728
2829
# STAGE 2: Pare that back to the bare essentials.
2930
3031
--- Dockerfile
+++ Dockerfile
@@ -1,29 +1,30 @@
1 # STAGE 1: Build a static Fossil binary atop Alpine Linux
2
3 # Avoid the temptation to swap the wget call below out for an ADD URL
4 # directive. The URL is fixed for a given release tag, which triggers
5 # Docker's caching behavior, causing it to reuse that version as long
6 # as it remains in the cache. We prefer to rely on the caching of the
7 # server instance on fossil-scm.org, which will keep these trunk
8 # tarballs around until the next trunk commit.
9
10 FROM alpine:latest AS builder
11 COPY tools/busybox-config /tmp/bbx/.config
12 ENV BBXVER "1_35_0"
13 ENV BBXURL "https://github.com/mirror/busybox/archive/refs/tags/${BBXVER}.tar.gz"
 
14 WORKDIR /tmp
15 RUN apk update \
16 && apk upgrade --no-cache \
17 && apk add --no-cache \
18 gcc make \
19 linux-headers musl-dev \
20 openssl-dev openssl-libs-static \
21 zlib-dev zlib-static \
22 && wget -O - ${BBXURL} | tar --strip-components=1 -C bbx -xz \
23 && ( cd bbx; make -j ) \
24 && wget -O - https://fossil-scm.org/home/tarball/src | tar -xz \
 
25 && src/configure --static CFLAGS='-Os -s' \
26 && make -j
27
28 # STAGE 2: Pare that back to the bare essentials.
29
30
--- Dockerfile
+++ Dockerfile
@@ -1,29 +1,30 @@
1 # STAGE 1: Build a static Fossil binary atop Alpine Linux
2
3 # Avoid the temptation to swap the wget call below out for an ADD URL
4 # directive. That URL is fixed for a given release tag, which triggers
5 # Docker's caching behavior, causing it to reuse that version as long
6 # as it remains in the cache. We prefer to rely on the caching of the
7 # server instance on fossil-scm.org, which will keep these trunk
8 # tarballs around until the next trunk commit.
9
10 FROM alpine:latest AS builder
11 COPY tools/busybox-config /tmp/bbx/.config
12 ENV BBXVER "1_35_0"
13 ENV BBXURL "https://github.com/mirror/busybox/archive/refs/tags/${BBXVER}.tar.gz"
14 ADD $BBXURL /tmp
15 WORKDIR /tmp
16 RUN apk update \
17 && apk upgrade --no-cache \
18 && apk add --no-cache \
19 gcc make \
20 linux-headers musl-dev \
21 openssl-dev openssl-libs-static \
22 zlib-dev zlib-static \
23 && tar --strip-components=1 -C bbx -xzf ${BBXVER}.tar.gz \
 
24 && wget -O - https://fossil-scm.org/home/tarball/src | tar -xz \
25 && ( cd bbx; make -j ) \
26 && src/configure --static CFLAGS='-Os -s' \
27 && make -j
28
29 # STAGE 2: Pare that back to the bare essentials.
30
31

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button