17

I am learning Docker, and I quite like it.

However, I don't understand, why does docker need root privileges for making containers, reading logs, and so on.

I have read some articles like this one

https://docs.docker.com/articles/security/

but all I see there is "docker needs root priviledges, because it can have access to root folders". Well, I wouldn't mind running dockers as non-root and give them access only to non-root user-owned folders in the outside system.

Why is that a problem?

2 Answers 2

11

Some "cool" docker features like port binding, mounting filesystems etc. strictly requires docker.io daemon to be run with super-user privileges.

However, you can use docker command line tool without root privileges if docker.io daemon is listening to a network port or it's unix socket is accessible for user to read and write.

It's a GREAT security violation and should not normally be used.

Additional details about Docker security: https://docs.docker.com/articles/security/

1
  • 3
    what should not normally be used? Dec 20, 2021 at 23:00
2

According to those links

dockers could not have networking, if it didn't have root priviledges, if I understand it correctly.

I am not sure if that's all.

0

You must log in to answer this question.

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