docker-compose builds as root
See original GitHub issueFirst, thank you very much for this wonderful node-boilerplate, It really does cover a long tech stack which I am trying to complete bit by bit.
Problem which I encountered when I tried to run this as described, simply did:
cd nodejs-api-starter
docker-compose up
And I get this error:
api_1 | EACCES: permission denied, mkdir 'build/emails'
api_1 | EACCES: permission denied, mkdir 'build/emails'
…
and so on.
The problem here is that the build directory created by running build.js through docker-compose is root protected and doesn’t allow any further changes, so the build process fails and finally the ./build/server.js is unavailable. I can manually create a build directory that is not root protected and repeat the process then it works. Probably something to do with docker’s functioning and my lack of experience in working with it. Can you help me figure out a work around?
screenshot: http://i.imgur.com/ckiomWY.png
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top GitHub Comments
I think probably something to do the way docker creates the directory on linux machine. https://github.com/docker/compose/issues/2781#issuecomment-176791391
https://stackoverflow.com/questions/33509752/docker-compose-creates-file-owned-by-root
Anyways instead of doing
mkdir build
the neater solution would be to just give the permission usingchown
Doing this works too:
sudo chown -R $USER:$USER .
docker-compose up
Thanks Since this is problem with the way docker is working on ubuntu, you can close this issue and create a reference. Again its a great project and I am kinda struggling with graphql-relay as I have only learned graphql just recently using express-graphql with graphiql interface to write queries, if you can suggest me a good place to start from, that would be a good help.
@smishr4 On our side, other than running an initial
mkdir build
as the account runningdocker-compose up
. I don’t know another way around it. The interesting thing is that this only happens for me on my ubuntu server, not on my local macOS. would be curious as to why that initial folder creation is run under root context.