2

Is there a way for users without root access to run a docker container?

To be clear, I am not asking if I can create a user in the container that runs as non-root. Rather, I need to know if and how a user, with absolutely no root or root-like privileges, can run a docker container in the first place.

I'm exploring some ways of distributing hard-to-build research/academic software, and docker has been suggested several times. A major concern for me, is that merely running docker containers requires root privileges, which could pose an issue for some users.

I have done at least an hours worth of google-fu-ing:

  • These sources (1, 2, 3) talk about creating containerized users who do not have root privilege, but I don't believe this allows a non-root user to run containers.

  • These sources (4, 5) talk about the docker group, but note that the docker group is root equivalent. This impresses me as being extraordinarily dangerous, not to mention pointless, and would never be allowed by our administrators for legal reasons.

  • This sources (6) talk about name-spacing, but I am not experienced enough in docker to know if this is what I am looking for.

3 Answers 3

0

I'm aware that this is an old question but this could help:

udocker is a basic user tool to execute simple docker containers in user space without requiring root privileges. Enables download and execution of docker containers by non-privileged users in Linux systems where docker is not available. It can be used to pull and execute docker containers in Linux batch systems and interactive clusters that are managed by other entities such as grid infrastructures or externally managed batch or interactive systems.

0

Docker has been working on rootless support which became GA in 20.10. It does have some drawbacks, e.g. networking and filesystem mounts have to be configured as an unprivileged user. And you'll want to configure the host with various prerequisites as root before you'll be able to run containers with rootless support. The full details including supported distributions and required prerequisites are listed on Docker's rootless page:

https://docs.docker.com/engine/security/rootless/

-1

Have you looked into bubblewrap?

https://github.com/projectatomic/bubblewrap

The Red Hat peeps are working with cri-o to run Linux without Docker.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .