Don't run Docker as root: what about a user with admin privileges?

Hi everyone, I read this article about not running docker as root. I want to run docker on my user which is an administrator, meaning I can do root privilege. My question does my user count as root?

1 Like

As in running rootless docker or running normal docker and using a non privileged user to controll it?

I just now that there’s 2 ways to install docker, but what I need is running normal docker and using a non privileged user to control it.

Since no os was mentioned, this answer assumes it is about the linux version.

The docker deamon is always run with root priviliges (except for rootless docker).

By default the docker.sock is owned by the root user and the docker group (the group is created during the istallation of docker), thus the docker (client) command can only be used by the root user or members of the docker group. If you want other users than root to use the docker command, you will need to assign them to the docker group.

Normal docker will always run as root, you can just allow non priviliged users to use the client!

Word of warning: every user that is able to use the docker cli, is able to mount the / filesystem into a container as root… Make sure you understand the impact before adding users to the docker group.

If you want a restricted user to run container without beeing able to become root inside a container, you might want to take a look at rootless-docker or podman (which is a drop-in replacement for docker).

2 Likes