4 ms·
I don't know if this addresses your question but... Check out 'runc'. It is the tool Docker uses to start a Docker container. In that program, there is a '-u
by amorphid 10y ago
I don't know if this addresses your question but...
Check out 'runc'. It is the tool Docker uses to start a Docker container. In that program, there is a '-u' option to start a container as whatever user ID (not username) you choose. Meaning you can start a container as a non-root user, although I don't know if that bubbles up as an option in the Docker public API, or can be set in a Dockerfile.
- zenlikethat 10y agoI'm not sure if it's what GP was talking about exactly, but there is USER instruction in Dockerfiles that lets you specify user to run as in the final image. Many Dockerfiles 'adduser' and then set USER to the newly created one.
- amorphid 10y ago(going from memory here, I believe this is accurate...) When attaching to a running Foo container w/ runc, the default user is root. That's true even if the Foo container was started w/ the Foo user. Can a Dockerfile specify the default user when someone attaches to the running container?