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.
Commit
d06d7c464e8deba651afabb61f800ff3d225dbc34e50884941e65b56d2453710
Parent
f21de33e97d5357…
1 file changed
+4
-3
+4
-3
| --- Dockerfile | ||
| +++ Dockerfile | ||
| @@ -1,29 +1,30 @@ | ||
| 1 | 1 | # STAGE 1: Build a static Fossil binary atop Alpine Linux |
| 2 | 2 | |
| 3 | 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 | |
| 4 | +# directive. That URL is fixed for a given release tag, which triggers | |
| 5 | 5 | # Docker's caching behavior, causing it to reuse that version as long |
| 6 | 6 | # as it remains in the cache. We prefer to rely on the caching of the |
| 7 | 7 | # server instance on fossil-scm.org, which will keep these trunk |
| 8 | 8 | # tarballs around until the next trunk commit. |
| 9 | 9 | |
| 10 | 10 | FROM alpine:latest AS builder |
| 11 | 11 | COPY tools/busybox-config /tmp/bbx/.config |
| 12 | 12 | ENV BBXVER "1_35_0" |
| 13 | 13 | ENV BBXURL "https://github.com/mirror/busybox/archive/refs/tags/${BBXVER}.tar.gz" |
| 14 | +ADD $BBXURL /tmp | |
| 14 | 15 | WORKDIR /tmp |
| 15 | 16 | RUN apk update \ |
| 16 | 17 | && apk upgrade --no-cache \ |
| 17 | 18 | && apk add --no-cache \ |
| 18 | 19 | gcc make \ |
| 19 | 20 | linux-headers musl-dev \ |
| 20 | 21 | openssl-dev openssl-libs-static \ |
| 21 | 22 | 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 \ | |
| 24 | 24 | && wget -O - https://fossil-scm.org/home/tarball/src | tar -xz \ |
| 25 | + && ( cd bbx; make -j ) \ | |
| 25 | 26 | && src/configure --static CFLAGS='-Os -s' \ |
| 26 | 27 | && make -j |
| 27 | 28 | |
| 28 | 29 | # STAGE 2: Pare that back to the bare essentials. |
| 29 | 30 | |
| 30 | 31 |
| --- 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 |