Fossil SCM

Added the CENGINE abstraction between `docker` and `podman` in the Makefile's container convenience targets.

wyoung 2023-04-01 16:49 trunk
Commit 72d8240457db851cbfbff6d675ebc0b85b367a2fa374d86eca133d2f66045fc9
2 files changed +11 -10 +13 -1
+11 -10
--- Makefile.in
+++ Makefile.in
@@ -121,15 +121,16 @@
121121
122122
# Container stuff
123123
SRCTB := src-@[email protected]
124124
IMGVER := fossil:@FOSSIL_CI_PFX@
125125
CNTVER := fossil-@FOSSIL_CI_PFX@
126
+CENGINE := docker
126127
container:
127
- docker image inspect $(IMGVER) > /dev/null 2>&1 || \
128
+ $(CENGINE) image inspect $(IMGVER) > /dev/null 2>&1 || \
128129
$(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 \
131132
--name $(CNTVER) \
132133
--cap-drop AUDIT_WRITE \
133134
--cap-drop CHOWN \
134135
--cap-drop FSETID \
135136
--cap-drop KILL \
@@ -140,28 +141,28 @@
140141
--cap-drop SETPCAP \
141142
--publish 8080:8080 \
142143
$(DCFLAGS) $(IMGVER) $(DCCMD)
143144
144145
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)
148149
149150
container-image:
150151
$(APPNAME) tarball --name src @FOSSIL_CI_PFX@ $(SRCTB)
151
- docker buildx build \
152
+ $(CENGINE) buildx build \
152153
--load \
153154
--tag $(IMGVER) \
154155
--build-arg FSLURL=$(SRCTB) \
155156
$(DBFLAGS) @srcdir@
156157
rm -f $(SRCTB)
157158
158159
container-run container-start: container
159
- docker start $(DSFLAGS) $(CNTVER)
160
+ $(CENGINE) start $(DSFLAGS) $(CNTVER)
160161
@sleep 1 # decrease likelihood of logging race condition
161
- docker container logs $(CNTVER)
162
+ $(CENGINE) container logs $(CNTVER)
162163
163164
container-stop:
164
- docker stop $(CNTVER)
165
+ $(CENGINE) stop $(CNTVER)
165166
166167
container-version:
167168
@echo $(CNTVER)
168169
--- 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
--- www/containers.md
+++ www/containers.md
@@ -468,11 +468,11 @@
468468
[lsl]: https://stackoverflow.com/questions/3430400/linux-static-linking-is-dead
469469
470470
471471
## 5. <a id="args"></a>Container Build Arguments
472472
473
-### <a id="pkg-vers"></a> 5.1 Package Versions
473
+### <a id="pkg-vers"></a> 5.1 Fossil Version
474474
475475
The default version of Fossil fetched in the build is the version in the
476476
checkout directory at the time you run it. You could override it to get
477477
a release build like so:
478478
@@ -544,10 +544,22 @@
544544
wish for [a static Fossil binary](#static). For those who want such a
545545
“batteries included” container, we recommend taking a look at [this
546546
alternative](https://hub.docker.com/r/duvel/fossil); needless to say,
547547
it’s inherently less secure than our stock container, but you may find
548548
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
+```
549561
550562
551563
## 6. <a id="light"></a>Lightweight Alternatives to Docker
552564
553565
Those afflicted with sticker shock at seeing the size of a [Docker
554566
--- 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

Keyboard Shortcuts

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