go-docker-dev icon indicating copy to clipboard operation
go-docker-dev copied to clipboard

Access denied

Open clarkezone opened this issue 6 years ago • 1 comments
trafficstars

I love this docker image and use it a bunch but have a bunch of security issues with it.. first off i have to chmod every source directory to 777 recursively in order for the container to be happy. Secondly if i try to go get aditional dependencies in the container i get access denied. What’s the recommended way of getting around these two issues?

thx

James

clarkezone avatar Mar 27 '19 05:03 clarkezone

This is a good question. Perhaps I should add a FAQ. The thing is that I don't want to use root inside the container, for obvious security reasons. That however entails that I have to choose a UID for the user running in the container. I chose 1000, which is the usual default first id. What is happening is that you have a different UID for your user (check with echo $UID), so the user in the container doesn't have access to the sources mounted from your host.

There are workarounds to this issue, but they are all annoying to put in place and make them work for everyone. The best solution for you would be to instead fork this image and change the UID of the dev user. It will work just fine for you. Change the line into:

RUN adduser dev --disabled-password --gecos "" --uid <MY_UID>

That's what actually several people did already.

mbrt avatar Mar 28 '19 16:03 mbrt