CyCoreSystems / docker-meteor

Dockerfile and script for running Meteor on Docker
MIT License
120 stars 73 forks source link

Permission issue #46

Closed harishreddy-m closed 7 years ago

harishreddy-m commented 7 years ago

I am trying to deploy in bundled way.

Docker version 1.13.1, build 092cba3

Running the command sudo docker run --rm -e ROOT_URL=http://10.0.2.185:3000 --link myapp-mongo:mongo-docker -v /home/harishreddy/myapp/:/home/meteor/www -e MONGO_URL=mongodb://mongo-docker:27017/myapp -e MONGO_OPLOG_URL=mongodb://mongo-docker:27017/local -e RELEASE=1.4.2.1 ulexus/meteor

Getting error

Error: EACCES: permission denied, mkdir '/home/meteor/www/bundle/programs/server/node_modules' npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, mkdir '/home/meteor/www/bundle/programs/server/node_modules'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'mkdir', npm ERR! path: '/home/meteor/www/bundle/programs/server/node_modules', npm ERR! fstream_type: 'Directory', npm ERR! fstream_path: '/home/meteor/www/bundle/programs/server/node_modules/asap', npm ERR! fstream_class: 'DirWriter', npm ERR! fstream_stack: npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/writer.js:171:25', npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53', npm ERR! 'FSReqWrap.oncomplete (fs.js:82:15)' ] } npm ERR! npm ERR! Please try running this command again as root/Administrator.

Ulexus commented 7 years ago

This is because you are bind-mounting /home/meteor/www AND the unprivileged user to which we drop (uid:1000) does not have write access to that directory.

harishreddy-m commented 7 years ago

I have given 776 permission to the directory I am mounting.Still same problem

harishreddy-m commented 7 years ago

drwxrwxrw- 3 harishreddy harishreddy 4096 Mar 1 06:34 ./ drwxrwxr-x 3 harishreddy harishreddy 4096 Mar 1 06:34 ../ drwxrwxrw- 4 harishreddy harishreddy 4096 Mar 1 06:34 bundle/

Ulexus commented 7 years ago

You need execute permission for any directory; thus, 777 permission.

harishreddy-m commented 7 years ago

Ok.777 solved the EACCESS issue.

Now getting this new error

bcrypt@0.8.7 install /home/meteor/www/bundle/programs/server/npm/node_modules/bcrypt node-gyp rebuild

gyp ERR! build error gyp ERR! stack Error: not found: make gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:14:12) gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:69:19) gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:81:29) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:90:16 gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/index.js:44:5 gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/node_modules/isexe/access.js:8:5 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Linux 4.4.0-64-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/meteor/www/bundle/programs/server/npm/node_modules/bcrypt gyp ERR! node -v v4.7.3 gyp ERR! node-gyp -v v3.4.0

Ulexus commented 7 years ago

Yes, if you use bcrypt, you will need the build tag variant. Use ulexus/meteor:build as the image.

harishreddy-m commented 7 years ago

Thanks!