docker-library / buildpack-deps

MIT License
450 stars 115 forks source link

images with sudo #84

Closed paleozogt closed 6 years ago

paleozogt commented 6 years ago

Could we get a -sudo variant?

The base Ubuntu images don't come with sudo. While this isn't really a problem when writing a Dockerfile, it can be a problem when using images on some CI/CD services that follow the best-practice of not running container processes as root.

This seems to vary by CI/CD service. Some (like GitLab) run the CI script as root in the container, while Azure Pipelines don't.

tianon commented 6 years ago

Even if we were to add sudo to these images, we would definitely not setup NOPASSWD: (or sudo group membership, for that matter), so there would still be enough setup for users of this image to do in order to be able to use sudo that I don't think it's worth us adding.

The steps required to install it are trivial (apt-get update && apt-get install -y sudo), and if one combines that with automated builds (https://docs.docker.com/docker-hub/builds/) and repository links (https://docs.docker.com/docker-hub/builds/#repository-links) and it's reasonably easy to have an up-to-date image built FROM this one with sudo pre-installed.