Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds UIDMap and GIDMap to containerConfig #14

Merged
merged 4 commits into from
Dec 11, 2024

Conversation

ShockWave-1
Copy link
Contributor

Adds UIDMap and GIDMap options to map ownership of the host user to the container user.

Although most situations are already covered by userNS and its many modes. There are situations where userNS doesnt cut it and can cause ownership/permission issues with volumes and mounts. This is especially prevalent in containers that use things like s6-overay which arent built to run under a rootless user. The process looses permissions if its set to anything else than UID/GID=0 which renders the container useless.

PS: also this merge request fixes a tiny typo in the flake.nix rootless example.

GIDMap allows for more advanced group configurations than userNS can do.
Useful for solving permission issues with containers that arent built to
run with rootless operation in mind.
Adds UIDMap option to quadlet-nix. Allows for more advanced UID
configurations. Useful for solving permission issues with containers
that arent designed to function rootless.
container.nix Outdated
@@ -142,6 +142,14 @@ let
description = "--user UID:...";
property = "Group";
};

gidMap = quadletUtils.mkOption {
type = types.nullOr types.str;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This key can be listed multiple times.

https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html#gidmap.

Let's make it a list and have a plural name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made the suggested changes. Their now lists and have plural names.

@SEIAROTg SEIAROTg changed the base branch from main to manually-merged December 11, 2024 02:01
@SEIAROTg SEIAROTg merged commit 72373e2 into SEIAROTg:manually-merged Dec 11, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants