Fossil SCM

Polishing pass on the container repo storage section of the build docs.

wyoung 2022-08-15 22:13 trunk
Commit 3e332637f15f88ffa3690e183be559ed1a1da1dd25bc52a6fb8551239f193031
1 file changed +12 -5
+12 -5
--- www/build.wiki
+++ www/build.wiki
@@ -273,11 +273,11 @@
273273
set, so you may wish to modify the <tt>Dockerfile</tt> to add
274274
configuration options, add APK packages to support those options, and so
275275
forth.
276276
277277
278
-<h3>5.1 Running It in Production</h3>
278
+<h3 id="docker-storage">5.1 Repository Storage Options</h3>
279279
280280
If you want the container to serve an existing repository, there are at
281281
least two right ways to do it.
282282
283283
The wrong way is to use the <tt>Dockerfile COPY</tt> command to bake it
@@ -288,10 +288,13 @@
288288
Docker. This is almost certainly not what you want.
289289
290290
The correct ways put the repo into the <i>container</i> created from the
291291
<i>image</i>, not in the image itself.
292292
293
+
294
+<h4>5.1.1 Storing the Repo Inside the Container</h4>
295
+
293296
The simplest method is to stop the container if it was running,
294297
then say:
295298
296299
<pre><code> $ docker cp /path/to/my-project.fossil fossil:/jail/museum/repo.fossil
297300
$ docker start fossil
@@ -304,16 +307,17 @@
304307
305308
(The same is true of the default mode of operation: the <tt>fossil
306309
server --create</tt> flag initializes a fresh Fossil repo atop the base
307310
image.)
308311
309
-Notice that the name of the repository database likely needs to change
310
-in the copy. The container configuration expects it to be called
312
+Notice that the copy command changes the name of the repository database.
313
+The container configuration expects it to be called
311314
<tt>repo.fossil</tt>, which it almost certainly was not out on the host
312315
system. This is because there is only one repository inside this
313316
container, so we don't have to name it after the project it contains, as
314
-is traditional.
317
+is traditional. A generic name lets us hard-code the server start
318
+command.
315319
316320
If you skip the "chown" command above and put "http://localhost:9999/" into
317321
your browser, expecting to see the copied-in repo's home page, you will
318322
get an opaque "Not Found" error. This is because the user and
319323
group ID of the file will be that of your local user on the container's
@@ -324,11 +328,14 @@
324328
with that user's privileges after it enters the chroot.
325329
(See [#docker-args | below] for how to change this default.)
326330
You don't have to restart the server after fixing this with
327331
<tt>chmod</tt>: simply reload the browser, and Fossil will try again.
328332
329
-This simple method has a problem: Docker containers are designed to be
333
+
334
+<h4>5.1.2 Storing the Repo Outside the Container</h4>
335
+
336
+The simple storage method above has a problem: Docker containers are designed to be
330337
killed off at the slightest cause, rebuilt, and redeployed. If you do
331338
that with the repo inside the container, it gets destroyed, too. The
332339
solution is to replace the "run" command above with the following:
333340
334341
<pre><code> $ docker create \
335342
--- www/build.wiki
+++ www/build.wiki
@@ -273,11 +273,11 @@
273 set, so you may wish to modify the <tt>Dockerfile</tt> to add
274 configuration options, add APK packages to support those options, and so
275 forth.
276
277
278 <h3>5.1 Running It in Production</h3>
279
280 If you want the container to serve an existing repository, there are at
281 least two right ways to do it.
282
283 The wrong way is to use the <tt>Dockerfile COPY</tt> command to bake it
@@ -288,10 +288,13 @@
288 Docker. This is almost certainly not what you want.
289
290 The correct ways put the repo into the <i>container</i> created from the
291 <i>image</i>, not in the image itself.
292
 
 
 
293 The simplest method is to stop the container if it was running,
294 then say:
295
296 <pre><code> $ docker cp /path/to/my-project.fossil fossil:/jail/museum/repo.fossil
297 $ docker start fossil
@@ -304,16 +307,17 @@
304
305 (The same is true of the default mode of operation: the <tt>fossil
306 server --create</tt> flag initializes a fresh Fossil repo atop the base
307 image.)
308
309 Notice that the name of the repository database likely needs to change
310 in the copy. The container configuration expects it to be called
311 <tt>repo.fossil</tt>, which it almost certainly was not out on the host
312 system. This is because there is only one repository inside this
313 container, so we don't have to name it after the project it contains, as
314 is traditional.
 
315
316 If you skip the "chown" command above and put "http://localhost:9999/" into
317 your browser, expecting to see the copied-in repo's home page, you will
318 get an opaque "Not Found" error. This is because the user and
319 group ID of the file will be that of your local user on the container's
@@ -324,11 +328,14 @@
324 with that user's privileges after it enters the chroot.
325 (See [#docker-args | below] for how to change this default.)
326 You don't have to restart the server after fixing this with
327 <tt>chmod</tt>: simply reload the browser, and Fossil will try again.
328
329 This simple method has a problem: Docker containers are designed to be
 
 
 
330 killed off at the slightest cause, rebuilt, and redeployed. If you do
331 that with the repo inside the container, it gets destroyed, too. The
332 solution is to replace the "run" command above with the following:
333
334 <pre><code> $ docker create \
335
--- www/build.wiki
+++ www/build.wiki
@@ -273,11 +273,11 @@
273 set, so you may wish to modify the <tt>Dockerfile</tt> to add
274 configuration options, add APK packages to support those options, and so
275 forth.
276
277
278 <h3 id="docker-storage">5.1 Repository Storage Options</h3>
279
280 If you want the container to serve an existing repository, there are at
281 least two right ways to do it.
282
283 The wrong way is to use the <tt>Dockerfile COPY</tt> command to bake it
@@ -288,10 +288,13 @@
288 Docker. This is almost certainly not what you want.
289
290 The correct ways put the repo into the <i>container</i> created from the
291 <i>image</i>, not in the image itself.
292
293
294 <h4>5.1.1 Storing the Repo Inside the Container</h4>
295
296 The simplest method is to stop the container if it was running,
297 then say:
298
299 <pre><code> $ docker cp /path/to/my-project.fossil fossil:/jail/museum/repo.fossil
300 $ docker start fossil
@@ -304,16 +307,17 @@
307
308 (The same is true of the default mode of operation: the <tt>fossil
309 server --create</tt> flag initializes a fresh Fossil repo atop the base
310 image.)
311
312 Notice that the copy command changes the name of the repository database.
313 The container configuration expects it to be called
314 <tt>repo.fossil</tt>, which it almost certainly was not out on the host
315 system. This is because there is only one repository inside this
316 container, so we don't have to name it after the project it contains, as
317 is traditional. A generic name lets us hard-code the server start
318 command.
319
320 If you skip the "chown" command above and put "http://localhost:9999/" into
321 your browser, expecting to see the copied-in repo's home page, you will
322 get an opaque "Not Found" error. This is because the user and
323 group ID of the file will be that of your local user on the container's
@@ -324,11 +328,14 @@
328 with that user's privileges after it enters the chroot.
329 (See [#docker-args | below] for how to change this default.)
330 You don't have to restart the server after fixing this with
331 <tt>chmod</tt>: simply reload the browser, and Fossil will try again.
332
333
334 <h4>5.1.2 Storing the Repo Outside the Container</h4>
335
336 The simple storage method above has a problem: Docker containers are designed to be
337 killed off at the slightest cause, rebuilt, and redeployed. If you do
338 that with the repo inside the container, it gets destroyed, too. The
339 solution is to replace the "run" command above with the following:
340
341 <pre><code> $ docker create \
342

Keyboard Shortcuts

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