Using overlay in volume specification not working (podman)
Summary
Not possible to enable the O
flag for a volume
From https://docs.podman.io/en/latest/markdown/podman-run.1.html
The :O flag tells Podman to mount the directory from the rootfs path as storage using the overlay file system. The container processes can modify content within the mount point which is stored in the container storage in a separate directory. In overlay terms, the source directory is the lower, and the container storage directory is the upper. Modifications to the mount point are destroyed when the container finishes executing, similar to a tmpfs mount point being unmounted.
When adding the O
flag to the volume def in config.toml
gitlab-runner refuses to start the job:
ERROR: Job failed: invalid volume specification:
"/srv/shared:/srv/shared:O"
Steps to reproduce
Add :O
to the volume def, example:
config.toml
[runners.docker]
host = "unix:///run/gitlab-podman/podman.sock"
volumes = ["/srv/shared:/srv/shared:O"]
Actual behavior
ERROR: Job failed: invalid volume specification:
"/srv/shared:/srv/shared:O"
Expected behavior
Job should start using an overlay mount so the volume is "virtually" writable inside the container.
Environment description
Podman version 4.5.1
Used GitLab Runner version
Gitlab runner version: 15.9.1
Possible fixes
The parser does not allow the O
flag
https://gitlab.com/gitlab-org/gitlab-runner/-/blob/main/executors/docker/internal/volumes/parser/linux_parser.go