dev-environment icon indicating copy to clipboard operation
dev-environment copied to clipboard

run image as a non 1000 user prevent from editing files

Open zesk06 opened this issue 4 years ago • 1 comments

TL;DR: Do you have any hint on using this technique if you user is not 1000?

Context: I am a docker-vim person like you, and i ended up with many plugins, and also wrote a Dockerfile to make my dev env 'portable' in a docker image. But, I struggle with the uid defined in the Dockerfile, usually 1000 like yours. My uid is not the same on every computer which prevent from mounting current PWD to a volume for edition within the container. So I ended up adding a variable to the Dockerfile MUID, and creating as many docker image as I have different UID. See Dockerfile

Do you have the same issue with UID? Do you see any solution?

zesk06 avatar May 08 '21 05:05 zesk06

You could make user dir more permissive, and do something like this:

docker run --user 1337:1000 -ti -eTERM=xterm-256color -eHOME=/work -v$(pwd):/work/project nemanjan00/dev zsh -ic "cd project ; tmux"

nemanjan00 avatar May 17 '21 14:05 nemanjan00