I need some general advice for how to set up permissions on a Docker host. I’m not yet using swarm, orchestration, or external personal registries: I’m SSHing into the server and checking out docker-compose projects from source control:
/var/docker
├ project_a
└ project_b
Then I just docker-compose run --build -d
inside those directories (which tend to have Dockerfile
s and configs that get built at up
time).
However, I’ve got a couple of other people on my team to whom I want to give the keys to be able to update code and rerun docker-compose up
, etc.
So those project directories (and/or group and/or sudoers configurations) need to have permissions such that:
- Certain other users (
joe
,jane
,bob
) and I (jamie
) can manipulate the files and rundocker-compose
commands against them. - Other users cannot.
I was thinking of doing something like:
- creating a
deployer
user, adding that to thedocker
group, and having the users switch to that to do deployments - giving
/var/docker
filesdeployer:docker
ownership and XX0 (no “other”) access
Thoughts?
Thanks,
Jamie