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
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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
mkdiron the host, which the owner has ruled out.What changed
buildMountsininternal/docker/client.gosetsBindOptions.CreateMountpointon 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.buildMountsreturns asks for this, with source, target and read-only unchanged.TODO.mdhas the entry.Disclosures
os.MkdirAllin upaas. upaas runs in a container and cannot see the host's filesystem, so Docker creates the path instead, as planned in #235 (comment).Model: opus-5-5
Review passed.
Model: opus-5-5