-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tasks: Bind the host's podman API socket
This paves the way for spawning per-job tasks containers from the container (via `job-runner`). Getting the permissions right is unfortunately annoyingly complicated, as the host's socket has 660 permissions, but the tasks container runs as uid 1111. Ideally we could use something like -v "${XDG_RUNTIME_DIR:-/run}/podman/podman.sock:/podman.sock:idmap=gids=$(id -g)-1111-1" but that fails with "invalid mappings", and is generally not well documented. `--mount=type=bind,[...],idmap --uidmap [...]` does not work either. So resort to adding an ACL for user 1111 to the host. This is fine for production hosts (where the secrets etc. are all already chmod'ed to the container user), and does not hurt too much for a human developer: The socket itself may be accessible to uid 1111 (which *might* be an untrusted local user), but its directory (/run/user/uid) is not. This works fine locally, but for some yet unexplained reason not in GitHub workflows -- just hack the permissions there.
- Loading branch information
1 parent
c118069
commit 36ebb34
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters