No. Having Docker installed doesn't allow anyone to use it by default.
$ docker info
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/info: dial unix /var/run/docker.sock: connect: permission denied
As an ordinary user, you don't have the privilege to even connect to the Docker daemon, let alone instruct it to run something in a container.
On the other hand, any user who is in the docker
group effectively has root powers on the host. It's very difficult to allow users to create a Docker container without giving them root powers on the host. You can allow users to run an application in a Docker container if the container is configured securely. A secure configuration must not grant access to any sensitive files on the host and should include a USER
directive that doesn't grant root access inside the container. (Preventing root from escaping a container is possible, but tricky.)
The “sudo replacement” is adduser alice docker
or having alice ALL = ( : docker) docker
in /etc/sudoers
, not merely installing docker.io
.
docker
requires root to run so no. Also you can run docker not as root with some limitations.sudo
replacement that doesn't ask for a password is simplysudo
. There is an option you can add to entries in thesudoers
to let that particular user use it without a password prompt. Not necessarily wise, but known behaviour and no sane distribution I'm aware of enables it by default -- its primary use case is on live images where there's only one user and no persistence.