nemanjan00 / dev-environment

My docker-based dev environment
52 stars 3 forks source link

run image as a non 1000 user prevent from editing files #1

Open zesk06 opened 3 years ago

zesk06 commented 3 years ago

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?

nemanjan00 commented 3 years ago

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"