Fossil SCM
Added the CENGINE abstraction between `docker` and `podman` in the Makefile's container convenience targets.
Commit
72d8240457db851cbfbff6d675ebc0b85b367a2fa374d86eca133d2f66045fc9
Parent
b14165549cf1abf…
2 files changed
+11
-10
+13
-1
+11
-10
| --- Makefile.in | ||
| +++ Makefile.in | ||
| @@ -121,15 +121,16 @@ | ||
| 121 | 121 | |
| 122 | 122 | # Container stuff |
| 123 | 123 | SRCTB := src-@[email protected] |
| 124 | 124 | IMGVER := fossil:@FOSSIL_CI_PFX@ |
| 125 | 125 | CNTVER := fossil-@FOSSIL_CI_PFX@ |
| 126 | +CENGINE := docker | |
| 126 | 127 | container: |
| 127 | - docker image inspect $(IMGVER) > /dev/null 2>&1 || \ | |
| 128 | + $(CENGINE) image inspect $(IMGVER) > /dev/null 2>&1 || \ | |
| 128 | 129 | $(MAKE) container-image |
| 129 | - docker container inspect $(CNTVER) > /dev/null 2>&1 || \ | |
| 130 | - docker create \ | |
| 130 | + $(CENGINE) container inspect $(CNTVER) > /dev/null 2>&1 || \ | |
| 131 | + $(CENGINE) create \ | |
| 131 | 132 | --name $(CNTVER) \ |
| 132 | 133 | --cap-drop AUDIT_WRITE \ |
| 133 | 134 | --cap-drop CHOWN \ |
| 134 | 135 | --cap-drop FSETID \ |
| 135 | 136 | --cap-drop KILL \ |
| @@ -140,28 +141,28 @@ | ||
| 140 | 141 | --cap-drop SETPCAP \ |
| 141 | 142 | --publish 8080:8080 \ |
| 142 | 143 | $(DCFLAGS) $(IMGVER) $(DCCMD) |
| 143 | 144 | |
| 144 | 145 | container-clean: |
| 145 | - -docker container kill $(CNTVER) | |
| 146 | - -docker container rm $(CNTVER) | |
| 147 | - -docker image rm $(IMGVER) | |
| 146 | + -$(CENGINE) container kill $(CNTVER) | |
| 147 | + -$(CENGINE) container rm $(CNTVER) | |
| 148 | + -$(CENGINE) image rm $(IMGVER) | |
| 148 | 149 | |
| 149 | 150 | container-image: |
| 150 | 151 | $(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB) |
| 151 | - docker buildx build \ | |
| 152 | + $(CENGINE) buildx build \ | |
| 152 | 153 | --load \ |
| 153 | 154 | --tag $(IMGVER) \ |
| 154 | 155 | --build-arg FSLURL=$(SRCTB) \ |
| 155 | 156 | $(DBFLAGS) @srcdir@ |
| 156 | 157 | rm -f $(SRCTB) |
| 157 | 158 | |
| 158 | 159 | container-run container-start: container |
| 159 | - docker start $(DSFLAGS) $(CNTVER) | |
| 160 | + $(CENGINE) start $(DSFLAGS) $(CNTVER) | |
| 160 | 161 | @sleep 1 # decrease likelihood of logging race condition |
| 161 | - docker container logs $(CNTVER) | |
| 162 | + $(CENGINE) container logs $(CNTVER) | |
| 162 | 163 | |
| 163 | 164 | container-stop: |
| 164 | - docker stop $(CNTVER) | |
| 165 | + $(CENGINE) stop $(CNTVER) | |
| 165 | 166 | |
| 166 | 167 | container-version: |
| 167 | 168 | @echo $(CNTVER) |
| 168 | 169 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -121,15 +121,16 @@ | |
| 121 | |
| 122 | # Container stuff |
| 123 | SRCTB := src-@[email protected] |
| 124 | IMGVER := fossil:@FOSSIL_CI_PFX@ |
| 125 | CNTVER := fossil-@FOSSIL_CI_PFX@ |
| 126 | container: |
| 127 | docker image inspect $(IMGVER) > /dev/null 2>&1 || \ |
| 128 | $(MAKE) container-image |
| 129 | docker container inspect $(CNTVER) > /dev/null 2>&1 || \ |
| 130 | docker create \ |
| 131 | --name $(CNTVER) \ |
| 132 | --cap-drop AUDIT_WRITE \ |
| 133 | --cap-drop CHOWN \ |
| 134 | --cap-drop FSETID \ |
| 135 | --cap-drop KILL \ |
| @@ -140,28 +141,28 @@ | |
| 140 | --cap-drop SETPCAP \ |
| 141 | --publish 8080:8080 \ |
| 142 | $(DCFLAGS) $(IMGVER) $(DCCMD) |
| 143 | |
| 144 | container-clean: |
| 145 | -docker container kill $(CNTVER) |
| 146 | -docker container rm $(CNTVER) |
| 147 | -docker image rm $(IMGVER) |
| 148 | |
| 149 | container-image: |
| 150 | $(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB) |
| 151 | docker buildx build \ |
| 152 | --load \ |
| 153 | --tag $(IMGVER) \ |
| 154 | --build-arg FSLURL=$(SRCTB) \ |
| 155 | $(DBFLAGS) @srcdir@ |
| 156 | rm -f $(SRCTB) |
| 157 | |
| 158 | container-run container-start: container |
| 159 | docker start $(DSFLAGS) $(CNTVER) |
| 160 | @sleep 1 # decrease likelihood of logging race condition |
| 161 | docker container logs $(CNTVER) |
| 162 | |
| 163 | container-stop: |
| 164 | docker stop $(CNTVER) |
| 165 | |
| 166 | container-version: |
| 167 | @echo $(CNTVER) |
| 168 |
| --- Makefile.in | |
| +++ Makefile.in | |
| @@ -121,15 +121,16 @@ | |
| 121 | |
| 122 | # Container stuff |
| 123 | SRCTB := src-@[email protected] |
| 124 | IMGVER := fossil:@FOSSIL_CI_PFX@ |
| 125 | CNTVER := fossil-@FOSSIL_CI_PFX@ |
| 126 | CENGINE := docker |
| 127 | container: |
| 128 | $(CENGINE) image inspect $(IMGVER) > /dev/null 2>&1 || \ |
| 129 | $(MAKE) container-image |
| 130 | $(CENGINE) container inspect $(CNTVER) > /dev/null 2>&1 || \ |
| 131 | $(CENGINE) create \ |
| 132 | --name $(CNTVER) \ |
| 133 | --cap-drop AUDIT_WRITE \ |
| 134 | --cap-drop CHOWN \ |
| 135 | --cap-drop FSETID \ |
| 136 | --cap-drop KILL \ |
| @@ -140,28 +141,28 @@ | |
| 141 | --cap-drop SETPCAP \ |
| 142 | --publish 8080:8080 \ |
| 143 | $(DCFLAGS) $(IMGVER) $(DCCMD) |
| 144 | |
| 145 | container-clean: |
| 146 | -$(CENGINE) container kill $(CNTVER) |
| 147 | -$(CENGINE) container rm $(CNTVER) |
| 148 | -$(CENGINE) image rm $(IMGVER) |
| 149 | |
| 150 | container-image: |
| 151 | $(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB) |
| 152 | $(CENGINE) buildx build \ |
| 153 | --load \ |
| 154 | --tag $(IMGVER) \ |
| 155 | --build-arg FSLURL=$(SRCTB) \ |
| 156 | $(DBFLAGS) @srcdir@ |
| 157 | rm -f $(SRCTB) |
| 158 | |
| 159 | container-run container-start: container |
| 160 | $(CENGINE) start $(DSFLAGS) $(CNTVER) |
| 161 | @sleep 1 # decrease likelihood of logging race condition |
| 162 | $(CENGINE) container logs $(CNTVER) |
| 163 | |
| 164 | container-stop: |
| 165 | $(CENGINE) stop $(CNTVER) |
| 166 | |
| 167 | container-version: |
| 168 | @echo $(CNTVER) |
| 169 |
+13
-1
| --- www/containers.md | ||
| +++ www/containers.md | ||
| @@ -468,11 +468,11 @@ | ||
| 468 | 468 | [lsl]: https://stackoverflow.com/questions/3430400/linux-static-linking-is-dead |
| 469 | 469 | |
| 470 | 470 | |
| 471 | 471 | ## 5. <a id="args"></a>Container Build Arguments |
| 472 | 472 | |
| 473 | -### <a id="pkg-vers"></a> 5.1 Package Versions | |
| 473 | +### <a id="pkg-vers"></a> 5.1 Fossil Version | |
| 474 | 474 | |
| 475 | 475 | The default version of Fossil fetched in the build is the version in the |
| 476 | 476 | checkout directory at the time you run it. You could override it to get |
| 477 | 477 | a release build like so: |
| 478 | 478 | |
| @@ -544,10 +544,22 @@ | ||
| 544 | 544 | wish for [a static Fossil binary](#static). For those who want such a |
| 545 | 545 | “batteries included” container, we recommend taking a look at [this |
| 546 | 546 | alternative](https://hub.docker.com/r/duvel/fossil); needless to say, |
| 547 | 547 | it’s inherently less secure than our stock container, but you may find |
| 548 | 548 | the tradeoff worthwhile. |
| 549 | + | |
| 550 | +### 5.4 <a id="cengine"></a>Container Engine | |
| 551 | + | |
| 552 | +Although the Fossil container build system defaults to Docker, we allow | |
| 553 | +for use of any OCI container system that implements the same interfaces. | |
| 554 | +We go into more details about this in [the next section](#light), but | |
| 555 | +for now, it suffices to point out that you can switch to Podman while | |
| 556 | +using our `Makefile` convenience targets unchanged by saying: | |
| 557 | + | |
| 558 | +``` | |
| 559 | + $ make CENGINE=podman container-run | |
| 560 | +``` | |
| 549 | 561 | |
| 550 | 562 | |
| 551 | 563 | ## 6. <a id="light"></a>Lightweight Alternatives to Docker |
| 552 | 564 | |
| 553 | 565 | Those afflicted with sticker shock at seeing the size of a [Docker |
| 554 | 566 |
| --- www/containers.md | |
| +++ www/containers.md | |
| @@ -468,11 +468,11 @@ | |
| 468 | [lsl]: https://stackoverflow.com/questions/3430400/linux-static-linking-is-dead |
| 469 | |
| 470 | |
| 471 | ## 5. <a id="args"></a>Container Build Arguments |
| 472 | |
| 473 | ### <a id="pkg-vers"></a> 5.1 Package Versions |
| 474 | |
| 475 | The default version of Fossil fetched in the build is the version in the |
| 476 | checkout directory at the time you run it. You could override it to get |
| 477 | a release build like so: |
| 478 | |
| @@ -544,10 +544,22 @@ | |
| 544 | wish for [a static Fossil binary](#static). For those who want such a |
| 545 | “batteries included” container, we recommend taking a look at [this |
| 546 | alternative](https://hub.docker.com/r/duvel/fossil); needless to say, |
| 547 | it’s inherently less secure than our stock container, but you may find |
| 548 | the tradeoff worthwhile. |
| 549 | |
| 550 | |
| 551 | ## 6. <a id="light"></a>Lightweight Alternatives to Docker |
| 552 | |
| 553 | Those afflicted with sticker shock at seeing the size of a [Docker |
| 554 |
| --- www/containers.md | |
| +++ www/containers.md | |
| @@ -468,11 +468,11 @@ | |
| 468 | [lsl]: https://stackoverflow.com/questions/3430400/linux-static-linking-is-dead |
| 469 | |
| 470 | |
| 471 | ## 5. <a id="args"></a>Container Build Arguments |
| 472 | |
| 473 | ### <a id="pkg-vers"></a> 5.1 Fossil Version |
| 474 | |
| 475 | The default version of Fossil fetched in the build is the version in the |
| 476 | checkout directory at the time you run it. You could override it to get |
| 477 | a release build like so: |
| 478 | |
| @@ -544,10 +544,22 @@ | |
| 544 | wish for [a static Fossil binary](#static). For those who want such a |
| 545 | “batteries included” container, we recommend taking a look at [this |
| 546 | alternative](https://hub.docker.com/r/duvel/fossil); needless to say, |
| 547 | it’s inherently less secure than our stock container, but you may find |
| 548 | the tradeoff worthwhile. |
| 549 | |
| 550 | ### 5.4 <a id="cengine"></a>Container Engine |
| 551 | |
| 552 | Although the Fossil container build system defaults to Docker, we allow |
| 553 | for use of any OCI container system that implements the same interfaces. |
| 554 | We go into more details about this in [the next section](#light), but |
| 555 | for now, it suffices to point out that you can switch to Podman while |
| 556 | using our `Makefile` convenience targets unchanged by saying: |
| 557 | |
| 558 | ``` |
| 559 | $ make CENGINE=podman container-run |
| 560 | ``` |
| 561 | |
| 562 | |
| 563 | ## 6. <a id="light"></a>Lightweight Alternatives to Docker |
| 564 | |
| 565 | Those afflicted with sticker shock at seeing the size of a [Docker |
| 566 |