Have Docker create a missing volume host path (closes #235) #252

Merged
clawbot merged 1 commits from issue-235-bind-create-mountpoint into next 2026-10-01 20:48:13 +02:00
Collaborator

Fixes #235.

What was wrong

Docker refuses to bind-mount a host path that does not exist, and upaas mounts every app volume as a bind mount. A new app's first deploy failed until someone ran mkdir on the host, which the owner has ruled out.

What changed

  • buildMounts in internal/docker/client.go sets BindOptions.CreateMountpoint on every bind mount. The Docker daemon then creates a missing host path (empty, owned by root, mode 0755) when the container starts, and leaves an existing path alone.
  • A test checks that every mount buildMounts returns asks for this, with source, target and read-only unchanged.
  • README: a new "Volume mounts" section says Docker creates a missing host directory and needs no manual step. TODO.md has the entry.

Disclosures

  • Deviation: the definition of done asked for os.MkdirAll in upaas. upaas runs in a container and cannot see the host's filesystem, so Docker creates the path instead, as planned in #235 (comment).
  • This needs Docker Engine 23.0 or later; an older engine ignores the option and a missing path still fails the deploy. I have not checked the engine version on fsn1app1.
  • The test covers what upaas asks Docker for, not Docker creating the directory.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/upaas/issues/235. ## What was wrong Docker refuses to bind-mount a host path that does not exist, and upaas mounts every app volume as a bind mount. A new app's first deploy failed until someone ran `mkdir` on the host, which the owner has ruled out. ## What changed - `buildMounts` in `internal/docker/client.go` sets `BindOptions.CreateMountpoint` on every bind mount. The Docker daemon then creates a missing host path (empty, owned by root, mode 0755) when the container starts, and leaves an existing path alone. - A test checks that every mount `buildMounts` returns asks for this, with source, target and read-only unchanged. - README: a new "Volume mounts" section says Docker creates a missing host directory and needs no manual step. `TODO.md` has the entry. ## Disclosures - Deviation: the definition of done asked for `os.MkdirAll` in upaas. upaas runs in a container and cannot see the host's filesystem, so Docker creates the path instead, as planned in https://git.eeqj.de/sneak/upaas/issues/235#issuecomment-107892. - This needs Docker Engine 23.0 or later; an older engine ignores the option and a missing path still fails the deploy. I have not checked the engine version on fsn1app1. - The test covers what upaas asks Docker for, not Docker creating the directory. Model: opus-5-5
clawbot added the needs-review label 2026-10-01 20:40:57 +02:00
clawbot self-assigned this 2026-10-01 20:40:57 +02:00
clawbot added 1 commit 2026-10-01 20:40:58 +02:00
Docker refused to bind-mount a host path that did not exist, so an app's
first deploy failed until someone ran mkdir on the host. buildMounts now
sets BindOptions.CreateMountpoint on every bind mount, so the Docker
daemon creates a missing host path when the container starts and leaves
an existing one alone. upaas itself cannot create it: it runs in a
container and does not see the host's filesystem. The README gains a
Volume mounts section saying so.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit d69f11f74c into next 2026-10-01 20:48:13 +02:00
clawbot deleted branch issue-235-bind-create-mountpoint 2026-10-01 20:48:14 +02:00
Sign in to join this conversation.