I'm currently experimenting on Docker specifically on the aspect where a user inside given container affects the Docker host itself. Ultimately, I want the user to be able to run containers on its very own host from inside its container. It kind of sounds a little absurd, but I'm hoping it works.
At the moment, I'm looking for a way for that given user to be part of the Docker host's docker
group. Is there a way to do that?
To create a common user, you must be connected to the root. You can optionally specify CONTAINER = ALL , which is the default when you are connected to the root. To create a local user, you must be connected to a PDB. You can optionally specify CONTAINER = CURRENT , which is the default when you are connected to a PDB.
Running Commands as a Different User in a Docker Container To run a command as a different user inside your container, add the --user flag: docker exec --user guest container-name whoami.
Multiple users on the same host can use docker.
From the perspective of the Docker host, any users inside the container are treated exactly the same as a user outside the container with the same UID (not the same name!), regardless of whether the UID is actually in use on the host. Unfortunately, it appears that only users with a username can belong to groups, so you can't just add the UID to the group. Instead, you need to add the host user with the same UID to the group (or create a user with that UID if one doesn't exist).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With