You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or a Pull Request
I have a setup where we use --volume on create cluster to mount some directories. On Linux, the files and directories in the volume are owned by root, which means we have to use sudo in scripts and make tasks, but only on Linux. moby/moby#3124 (comment) explains the key points pretty good, and suggests that you pass your current user through the --user flag: https://docs.docker.com/engine/reference/run/#user
I'd like to expose that flag through k3d to ensure the permissions and owner of the volumes can be myself, and therefore also have the same behavior on Linux and OSX.
Scope of your request
add flag to k3d cluster create (and possibly others)
Describe the solution you'd like
Add --user flag to k3d cluster create (and possibly others) that is passed down to docker without any modification.
Describe alternatives you've considered
Use complicated scripts with OS checks together with sudo/chmod/chown to make volumes work on all systems.
The text was updated successfully, but these errors were encountered:
Hi @zepatrik , thanks for opening this issue!
This is a valid use-case indeed.
However, the k3s image doesn't provider user management and k3s must run as root unless you disable the agent component (or possibly use the experimental rootless mode): docker run --rm --privileged --user 1000 xyz/k3s:dev-20210427.1 servertime="2021-05-06T16:57:22.311675640Z" level=fatal msg="must run as root unless --disable-agent is specified"
If you can figure out an easy way to do this, I'm more than happy to implement it (or accept a PR) :)
zepatrik
changed the title
[FEATURE] Add --user flag to enforce a special user
[FEATURE] Add --user flag to enforce a specific user (i.e. me, not root)
Aug 3, 2021
i also enter the same issue. User namesapece is set on my dev PC without the possibility to bypass.
so to workaround the error, i rebuild k3d using a little modif in "/pkg/runtimes/docker/translate.go" file (line 128):
/* They have to run in privileged mode */
// TODO: can we replace this by a reduced set of capabilities?
hostConfig.Privileged = true hostConfig.UsernsMode = "host"
Is your feature request related to a problem or a Pull Request
I have a setup where we use
--volume
on create cluster to mount some directories. On Linux, the files and directories in the volume are owned byroot
, which means we have to usesudo
in scripts and make tasks, but only on Linux.moby/moby#3124 (comment) explains the key points pretty good, and suggests that you pass your current user through the
--user
flag: https://docs.docker.com/engine/reference/run/#userI'd like to expose that flag through k3d to ensure the permissions and owner of the volumes can be myself, and therefore also have the same behavior on Linux and OSX.
Scope of your request
k3d cluster create
(and possibly others)Describe the solution you'd like
Add
--user
flag tok3d cluster create
(and possibly others) that is passed down to docker without any modification.Describe alternatives you've considered
Use complicated scripts with OS checks together with sudo/chmod/chown to make volumes work on all systems.
The text was updated successfully, but these errors were encountered: