Skip to content
New issue

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

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

Already on GitHub? # to your account

User that includes GID should be valid. #23

Closed
rany2 opened this issue Sep 14, 2024 · 2 comments · Fixed by #28
Closed

User that includes GID should be valid. #23

rany2 opened this issue Sep 14, 2024 · 2 comments · Fixed by #28
Labels
bug Something isn't working
Milestone

Comments

@rany2
Copy link

rany2 commented Sep 14, 2024

Please check the following related issue from a project that depends on this library: containers/podlet#106

In short, this compose file is invalid according to the library:

version: "3.7"
services:
  true:
    image: 'docker.io/busybox'
    command: 'true'
    user: 999:999

When the :999 GID portion is dropped, it works fine. It appears that the current implementation doesn't split : to get the group portion.

@k9withabone
Copy link
Owner

I'll respond here to both issues. It seems that the Compose Specification doesn't define user well. I found a relevant issue, compose-spec/compose-spec#39, but it's over 4.5 years old with no movement on it... Also, docker compose config accepts any string for user, regardless of whether it's a valid user/group name, which is unhelpful. So I guess I'll just have to go by what the docker-run(1) and podman-run(1) man pages say for --user.

@k9withabone k9withabone added the bug Something isn't working label Sep 21, 2024
@k9withabone k9withabone added this to the v0.2.1 milestone Sep 21, 2024
@k9withabone
Copy link
Owner

My initial plan for implementation is the following:

  • Rename UserOrGroup to IdOrName.
  • Add a User struct like so:
pub struct User {
    pub user: IdOrName,
    pub group: Option<IdOrName>,
}

Unfortunately, this has to be a breaking change.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants