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

Support additional groups (--group-add) #20

Merged
merged 1 commit into from Apr 21, 2018
Merged

Support additional groups (--group-add) #20

merged 1 commit into from Apr 21, 2018

Conversation

haines
Copy link
Contributor

@haines haines commented Apr 19, 2018

This PR adds an additional_groups option to the plugin which takes an array of groups (either names or ids), and translates them to --group-add options to pass to docker run.

I wanted to be able to do this because I'm trying to build Docker images as an unprivileged user, so I need to be in the docker group. My config would then be something like

docker#v1.1.1:
  image: "docker:latest"

  mounts:
    - /var/run/docker.sock:/var/run/docker.sock
    - # other mounts

  user: "501:502" # uid:gid of the user on the host, for access to the other mounts
  additional_groups:
    - 501 # gid of docker group on the host, for access to the docker socket

@haines haines changed the title Support --group-add Support additional groups (--group-add) Apr 19, 2018
@toolmantim
Copy link
Contributor

Thanks for th contribution! The PR looks great.

@toolmantim toolmantim merged commit b22b19c into buildkite-plugins:master Apr 21, 2018
@haines haines deleted the group-add branch April 21, 2018 22:45
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.

None yet

2 participants