问题原文
原帖链接 · Klangen · CC BY-SA 4.0
Recently I've been trying to run my Docker application as a non-root user. I've seen there are several options available to me:
- Install rootless Docker : apparently this is a "non-root" version of Docker that runs containers as users other than root.
- Use normal (rootful) Docker, but run containers with
docker runwith the--userflag. - User Podman to run the container.
I am not familiar with any of these solutions, I've only ever used Docker as root. So what are the differences and advantages/disadvantages of these methods?
Isn't the result exactly the same, i.e., a container running as non-root user?
已采纳解答
原帖链接 · shodanshok · CC BY-SA 4.0
They are different things.
docker run --usersets the UID to be used inside the container. It is useful to limit the privileges of the specific program which run within the container itselfrootless docker means running the
dockerdaemon itself as a non-privileged user. A flaw indockeritself will be contained without giving root permissions on the host system. From docker's docs:
Rootless mode allows running the Docker daemon and containers as a non-root user to mitigate potential vulnerabilities in the daemon and the container runtime.
podmanis a daemon-less reimplementation ofdocker. Not having a central daemon to run/manage all the container instances is supposed to be more secure and lightweight
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
