Fossil SCM

Did away with the temporary src.tar.gz file in the new Docker container by streaming the output of wget straight into tar's stdin. This cuts the build time by about five seconds, presumably due to the saving from unnecessary file I/O. Also replaced the explicit "cd src" afterward with an out-of-tree build configuration, since it doesn't matter if we clutter the first stage's /tmp dir.

wyoung 2022-08-06 19:56 trunk
Commit 289c9b501cb724adafdfb3d4575d06ab5158b75cebb90421a71a928844c2874f
1 file changed +10 -12
+10 -12
--- Dockerfile
+++ Dockerfile
@@ -7,29 +7,27 @@
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
WORKDIR /tmp
12
-RUN apk update \
13
- && apk upgrade --no-cache \
14
- && apk add --no-cache \
15
- busybox-static gcc make \
16
- musl-dev \
17
- openssl-dev openssl-libs-static \
18
- zlib-dev zlib-static \
19
- && wget https://fossil-scm.org/home/tarball/src.tar.gz \
20
- && tar -xf src.tar.gz \
21
- && cd src \
22
- && ./configure --static CFLAGS='-Os -s' \
12
+RUN apk update \
13
+ && apk upgrade --no-cache \
14
+ && apk add --no-cache \
15
+ busybox-static gcc make \
16
+ musl-dev \
17
+ openssl-dev openssl-libs-static \
18
+ zlib-dev zlib-static \
19
+ && wget -O - https://fossil-scm.org/home/tarball/src | tar -xz \
20
+ && src/configure --static CFLAGS='-Os -s' \
2321
&& make -j
2422
2523
# STAGE 2: Pare that back to the bare essentials.
2624
2725
FROM scratch
2826
ENV JAIL=/jail
2927
WORKDIR ${JAIL}
30
-COPY --from=builder /tmp/src/fossil ${JAIL}/bin/
28
+COPY --from=builder /tmp/fossil ${JAIL}/bin/
3129
COPY --from=builder /bin/busybox.static /bin/busybox
3230
RUN [ "/bin/busybox", "--install", "/bin" ]
3331
RUN mkdir -m 700 dev \
3432
&& mknod -m 600 dev/null c 1 3 \
3533
&& mknod -m 600 dev/urandom c 1 9
3634
--- Dockerfile
+++ Dockerfile
@@ -7,29 +7,27 @@
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 WORKDIR /tmp
12 RUN apk update \
13 && apk upgrade --no-cache \
14 && apk add --no-cache \
15 busybox-static gcc make \
16 musl-dev \
17 openssl-dev openssl-libs-static \
18 zlib-dev zlib-static \
19 && wget https://fossil-scm.org/home/tarball/src.tar.gz \
20 && tar -xf src.tar.gz \
21 && cd src \
22 && ./configure --static CFLAGS='-Os -s' \
23 && make -j
24
25 # STAGE 2: Pare that back to the bare essentials.
26
27 FROM scratch
28 ENV JAIL=/jail
29 WORKDIR ${JAIL}
30 COPY --from=builder /tmp/src/fossil ${JAIL}/bin/
31 COPY --from=builder /bin/busybox.static /bin/busybox
32 RUN [ "/bin/busybox", "--install", "/bin" ]
33 RUN mkdir -m 700 dev \
34 && mknod -m 600 dev/null c 1 3 \
35 && mknod -m 600 dev/urandom c 1 9
36
--- Dockerfile
+++ Dockerfile
@@ -7,29 +7,27 @@
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 WORKDIR /tmp
12 RUN apk update \
13 && apk upgrade --no-cache \
14 && apk add --no-cache \
15 busybox-static gcc make \
16 musl-dev \
17 openssl-dev openssl-libs-static \
18 zlib-dev zlib-static \
19 && wget -O - https://fossil-scm.org/home/tarball/src | tar -xz \
20 && src/configure --static CFLAGS='-Os -s' \
 
 
21 && make -j
22
23 # STAGE 2: Pare that back to the bare essentials.
24
25 FROM scratch
26 ENV JAIL=/jail
27 WORKDIR ${JAIL}
28 COPY --from=builder /tmp/fossil ${JAIL}/bin/
29 COPY --from=builder /bin/busybox.static /bin/busybox
30 RUN [ "/bin/busybox", "--install", "/bin" ]
31 RUN mkdir -m 700 dev \
32 && mknod -m 600 dev/null c 1 3 \
33 && mknod -m 600 dev/urandom c 1 9
34

Keyboard Shortcuts

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