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

Add group_add to job docker config #17108

Closed
Kamilcuk opened this issue May 8, 2023 · 3 comments · Fixed by #17313
Closed

Add group_add to job docker config #17108

Kamilcuk opened this issue May 8, 2023 · 3 comments · Fixed by #17313

Comments

@Kamilcuk
Copy link
Contributor

Kamilcuk commented May 8, 2023

Proposal

This is a proposal to add a group_add argument to docker task "config"-uration that will mimic the docker --group_add and docker compose group_add: options.

task "..." {
   driver = "docker"
   user = "user1:group1"
    config {
       image = "alpine"
       group_add = [
          "group1",
          "group2",
          "1234",
       ]
   }
}

From docker run --help:

  --group-add list                 Add additional groups to join

Use-cases

The use case is to run a user with more than one group. For example, there is an NFS share where directories are owned by specific, multiple, different groups.

Attempted Solutions

The solution or workaround is to create a custom image with Dockerfile where you RUN useradd && groupadd the required groups to the user.

Related:
#8066
@dnrce could you sign CLA? Thank you.
https://discuss.hashicorp.com/t/inject-default-user-group-for-docker-by-nomad-client/18895

@tgross
Copy link
Member

tgross commented May 8, 2023

@Kamilcuk can you do us a favor and revisit what you've written here and try to turn it into a specific proposal? This is a bunch of links and @-mentions of unrelated folks on a closed PR.

(Edit: thanks!)

@Kamilcuk Kamilcuk changed the title Please add group_add to job docker config Add group_add to job docker config May 8, 2023
@schmichael
Copy link
Member

Thanks for clarifying the issue @Kamilcuk. Looks like a straightforward case of Nomad needing to implement an additional Docker configuration option. I updated the labels so we can pick it up someday.

These sorts of plugin improvements are good opportunities for contributions as well, so I added the good first issue label. The Docker config parameters generally follow a pretty standard path in https://github.com/hashicorp/nomad/blob/v1.5.5/drivers/docker/config.go

Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants