Fossil SCM

Added the FSLCFG Dockerfile build arg and showed how to use it in the containers doc, plus other improvements to the doc while in there.

wyoung 2022-11-30 12:32 trunk
Commit e2277aad160f11fbcc6b6938ac9884cff0eb27dfce17768589ca4c11b7f072f7
2 files changed +7 -6 +31 -8
+7 -6
--- Dockerfile
+++ Dockerfile
@@ -29,12 +29,12 @@
2929
ARG BBXVER="1_35_0"
3030
ENV BBXURL "https://github.com/mirror/busybox/tarball/${BBXVER}"
3131
COPY containers/busybox-config /tmp/bbx/.config
3232
ADD $BBXURL /tmp/bbx/src.tar.gz
3333
RUN set -x \
34
- && tar --strip-components=1 -C bbx -xzf bbx/src.tar.gz \
35
- && ( cd bbx && yes "" | make oldconfig && make -j11 ) \
34
+ && tar --strip-components=1 -C bbx -xzf bbx/src.tar.gz \
35
+ && ( cd bbx && yes "" | make oldconfig && make -j11 ) \
3636
&& test ! -x /usr/bin/upx || upx -9q bbx/busybox
3737
3838
### The changeable Fossil layer is the only one in the first stage that
3939
### changes often, so add it last, to make it independent of the others.
4040
###
@@ -43,19 +43,20 @@
4343
### from a URL! It matters because we default to a URL in case you're
4444
### building outside a Fossil checkout, but when building via the
4545
### container-image target, we can avoid a costly hit on the Fossil
4646
### project's home site by pulling the data from the local repo via the
4747
### "tarball" command. This is a DVCS, after all!
48
+ARG FSLCFG=""
4849
ARG FSLVER="trunk"
4950
ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
5051
ENV FSLSTB=/tmp/fsl/src.tar.gz
5152
ADD $FSLURL $FSLSTB
5253
RUN set -x \
53
- && if [ -d $FSLSTB ] ; then mv $FSLSTB/src fsl ; \
54
- else tar -C fsl -xzf fsl/src.tar.gz ; fi \
55
- && m=fsl/src/src/main.mk \
56
- && fsl/src/configure --static CFLAGS='-Os -s' && make -j11 \
54
+ && if [ -d $FSLSTB ] ; then mv $FSLSTB/src fsl ; \
55
+ else tar -C fsl -xzf fsl/src.tar.gz ; fi \
56
+ && m=fsl/src/src/main.mk \
57
+ && fsl/src/configure --static CFLAGS='-Os -s' $FSLCFG && make -j11 \
5758
&& if [ -x /usr/bin/upx ] ; then upx -9q fossil ; fi
5859
5960
6061
## ---------------------------------------------------------------------
6162
## STAGE 2: Pare that back to the bare essentials.
6263
--- Dockerfile
+++ Dockerfile
@@ -29,12 +29,12 @@
29 ARG BBXVER="1_35_0"
30 ENV BBXURL "https://github.com/mirror/busybox/tarball/${BBXVER}"
31 COPY containers/busybox-config /tmp/bbx/.config
32 ADD $BBXURL /tmp/bbx/src.tar.gz
33 RUN set -x \
34 && tar --strip-components=1 -C bbx -xzf bbx/src.tar.gz \
35 && ( cd bbx && yes "" | make oldconfig && make -j11 ) \
36 && test ! -x /usr/bin/upx || upx -9q bbx/busybox
37
38 ### The changeable Fossil layer is the only one in the first stage that
39 ### changes often, so add it last, to make it independent of the others.
40 ###
@@ -43,19 +43,20 @@
43 ### from a URL! It matters because we default to a URL in case you're
44 ### building outside a Fossil checkout, but when building via the
45 ### container-image target, we can avoid a costly hit on the Fossil
46 ### project's home site by pulling the data from the local repo via the
47 ### "tarball" command. This is a DVCS, after all!
 
48 ARG FSLVER="trunk"
49 ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
50 ENV FSLSTB=/tmp/fsl/src.tar.gz
51 ADD $FSLURL $FSLSTB
52 RUN set -x \
53 && if [ -d $FSLSTB ] ; then mv $FSLSTB/src fsl ; \
54 else tar -C fsl -xzf fsl/src.tar.gz ; fi \
55 && m=fsl/src/src/main.mk \
56 && fsl/src/configure --static CFLAGS='-Os -s' && make -j11 \
57 && if [ -x /usr/bin/upx ] ; then upx -9q fossil ; fi
58
59
60 ## ---------------------------------------------------------------------
61 ## STAGE 2: Pare that back to the bare essentials.
62
--- Dockerfile
+++ Dockerfile
@@ -29,12 +29,12 @@
29 ARG BBXVER="1_35_0"
30 ENV BBXURL "https://github.com/mirror/busybox/tarball/${BBXVER}"
31 COPY containers/busybox-config /tmp/bbx/.config
32 ADD $BBXURL /tmp/bbx/src.tar.gz
33 RUN set -x \
34 && tar --strip-components=1 -C bbx -xzf bbx/src.tar.gz \
35 && ( cd bbx && yes "" | make oldconfig && make -j11 ) \
36 && test ! -x /usr/bin/upx || upx -9q bbx/busybox
37
38 ### The changeable Fossil layer is the only one in the first stage that
39 ### changes often, so add it last, to make it independent of the others.
40 ###
@@ -43,19 +43,20 @@
43 ### from a URL! It matters because we default to a URL in case you're
44 ### building outside a Fossil checkout, but when building via the
45 ### container-image target, we can avoid a costly hit on the Fossil
46 ### project's home site by pulling the data from the local repo via the
47 ### "tarball" command. This is a DVCS, after all!
48 ARG FSLCFG=""
49 ARG FSLVER="trunk"
50 ARG FSLURL="https://fossil-scm.org/home/tarball/src?r=${FSLVER}"
51 ENV FSLSTB=/tmp/fsl/src.tar.gz
52 ADD $FSLURL $FSLSTB
53 RUN set -x \
54 && if [ -d $FSLSTB ] ; then mv $FSLSTB/src fsl ; \
55 else tar -C fsl -xzf fsl/src.tar.gz ; fi \
56 && m=fsl/src/src/main.mk \
57 && fsl/src/configure --static CFLAGS='-Os -s' $FSLCFG && make -j11 \
58 && if [ -x /usr/bin/upx ] ; then upx -9q fossil ; fi
59
60
61 ## ---------------------------------------------------------------------
62 ## STAGE 2: Pare that back to the bare essentials.
63
--- www/containers.md
+++ www/containers.md
@@ -392,24 +392,33 @@
392392
don’t blindly update the BusyBox version merely because a new release
393393
came out. Someone needs to get around to vetting it against our stock
394394
configuration first.
395395
396396
As for Fossil, it defaults to fetching the same version as the checkout
397
-you’re running the build command from, based on checkin ID. The most
398
-common reason to override this is to get a release version:
397
+you’re running the build command from, based on checkin ID. You could
398
+use this to get a release build, for instance:
399399
400400
```
401401
$ docker build -t fossil \
402
- --build-arg FSLVER=version-2.19 .
402
+ --build-arg FSLVER=version-2.20 .
403
+```
404
+
405
+Or equivalently, using Fossil’s `Makefile` convenience target:
406
+
407
+```
408
+ $ make container-image \
409
+ DBFLAGS='--build-arg FSLVER=version-2.20'
403410
```
404411
405
-It’s best to use a specific version number rather than the generic
406
-“`release`” tag because Docker caches downloaded files and tries to
412
+While you could instead use the generic
413
+“`release`” tag here, it’s better to use a specific version number
414
+since Docker caches downloaded files and tries to
407415
reuse them across builds. If you ask for “`release`” before a new
408416
version is tagged and then immediately after, you might expect to get
409
-two different tarballs, but because the URL hasn’t changed, if you have
410
-an old release tarball in your Docker cache, you’ll get the old version
417
+two different tarballs, but because the underlying source tarball URL
418
+remains the same when you do that, you’ll end up reusing the
419
+old tarball from your Docker cache. This will occur
411420
even if you pass the “`docker build --no-cache`” option.
412421
413422
This is why we default to pulling the Fossil tarball by checkin ID
414423
rather than let it default to the generic “`trunk`” tag: so the URL will
415424
change each time you update your Fossil source tree, forcing Docker to
@@ -426,18 +435,32 @@
426435
close to zero as we can manage.
427436
428437
To change it to something else, say:
429438
430439
```
431
- $ docker build -t fossil --build-arg UID=501 .
440
+ $ make container-image \
441
+ DBFLAGS='--build-arg UID=501'
432442
```
433443
434444
This is particularly useful if you’re putting your repository on a
435445
Docker volume since the IDs “leak” out into the host environment via
436446
file permissions. You may therefore wish them to mean something on both
437447
sides of the container barrier rather than have “499” appear on the host
438448
in “`ls -l`” output.
449
+
450
+
451
+### 5.3 <a id="config"></a>Fossil Configuration Options
452
+
453
+You can use this same mechanism to enable non-default Fossil
454
+configuration options in your build. For instance, to turn on
455
+the JSON API and the TH1 docs extension:
456
+
457
+```
458
+ $ make container-image \
459
+ DBFLAGS='--build-arg FSLCFG="--json --with-th1-docs"'
460
+```
461
+
439462
440463
441464
## 6. <a id="light"></a>Lightweight Alternatives to Docker
442465
443466
Those afflicted with sticker shock at seeing the size of a [Docker
444467
--- www/containers.md
+++ www/containers.md
@@ -392,24 +392,33 @@
392 don’t blindly update the BusyBox version merely because a new release
393 came out. Someone needs to get around to vetting it against our stock
394 configuration first.
395
396 As for Fossil, it defaults to fetching the same version as the checkout
397 you’re running the build command from, based on checkin ID. The most
398 common reason to override this is to get a release version:
399
400 ```
401 $ docker build -t fossil \
402 --build-arg FSLVER=version-2.19 .
 
 
 
 
 
 
 
403 ```
404
405 It’s best to use a specific version number rather than the generic
406 “`release`” tag because Docker caches downloaded files and tries to
 
407 reuse them across builds. If you ask for “`release`” before a new
408 version is tagged and then immediately after, you might expect to get
409 two different tarballs, but because the URL hasn’t changed, if you have
410 an old release tarball in your Docker cache, you’ll get the old version
 
411 even if you pass the “`docker build --no-cache`” option.
412
413 This is why we default to pulling the Fossil tarball by checkin ID
414 rather than let it default to the generic “`trunk`” tag: so the URL will
415 change each time you update your Fossil source tree, forcing Docker to
@@ -426,18 +435,32 @@
426 close to zero as we can manage.
427
428 To change it to something else, say:
429
430 ```
431 $ docker build -t fossil --build-arg UID=501 .
 
432 ```
433
434 This is particularly useful if you’re putting your repository on a
435 Docker volume since the IDs “leak” out into the host environment via
436 file permissions. You may therefore wish them to mean something on both
437 sides of the container barrier rather than have “499” appear on the host
438 in “`ls -l`” output.
 
 
 
 
 
 
 
 
 
 
 
 
 
439
440
441 ## 6. <a id="light"></a>Lightweight Alternatives to Docker
442
443 Those afflicted with sticker shock at seeing the size of a [Docker
444
--- www/containers.md
+++ www/containers.md
@@ -392,24 +392,33 @@
392 don’t blindly update the BusyBox version merely because a new release
393 came out. Someone needs to get around to vetting it against our stock
394 configuration first.
395
396 As for Fossil, it defaults to fetching the same version as the checkout
397 you’re running the build command from, based on checkin ID. You could
398 use this to get a release build, for instance:
399
400 ```
401 $ docker build -t fossil \
402 --build-arg FSLVER=version-2.20 .
403 ```
404
405 Or equivalently, using Fossil’s `Makefile` convenience target:
406
407 ```
408 $ make container-image \
409 DBFLAGS='--build-arg FSLVER=version-2.20'
410 ```
411
412 While you could instead use the generic
413 “`release`” tag here, it’s better to use a specific version number
414 since Docker caches downloaded files and tries to
415 reuse them across builds. If you ask for “`release`” before a new
416 version is tagged and then immediately after, you might expect to get
417 two different tarballs, but because the underlying source tarball URL
418 remains the same when you do that, you’ll end up reusing the
419 old tarball from your Docker cache. This will occur
420 even if you pass the “`docker build --no-cache`” option.
421
422 This is why we default to pulling the Fossil tarball by checkin ID
423 rather than let it default to the generic “`trunk`” tag: so the URL will
424 change each time you update your Fossil source tree, forcing Docker to
@@ -426,18 +435,32 @@
435 close to zero as we can manage.
436
437 To change it to something else, say:
438
439 ```
440 $ make container-image \
441 DBFLAGS='--build-arg UID=501'
442 ```
443
444 This is particularly useful if you’re putting your repository on a
445 Docker volume since the IDs “leak” out into the host environment via
446 file permissions. You may therefore wish them to mean something on both
447 sides of the container barrier rather than have “499” appear on the host
448 in “`ls -l`” output.
449
450
451 ### 5.3 <a id="config"></a>Fossil Configuration Options
452
453 You can use this same mechanism to enable non-default Fossil
454 configuration options in your build. For instance, to turn on
455 the JSON API and the TH1 docs extension:
456
457 ```
458 $ make container-image \
459 DBFLAGS='--build-arg FSLCFG="--json --with-th1-docs"'
460 ```
461
462
463
464 ## 6. <a id="light"></a>Lightweight Alternatives to Docker
465
466 Those afflicted with sticker shock at seeing the size of a [Docker
467

Keyboard Shortcuts

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