verdaccio / docker-examples

🐳 ⛴A collection of Docker and Kubernetes examples for verdaccio

Home Page:https://www.verdaccio.org/docs/en/docker.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

docker build: permission denied

yansenlei opened this issue · comments

commented

Describe the bug
permission denied Error when using the docker example project

npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/jsdom/node_modules/request/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/raw-body/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/request/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/send/node_modules/http-errors/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/send/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/@verdaccio
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/uglify-js/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/verdaccio-audit/node_modules
npm WARN checkPermissions Missing write access to /opt/verdaccio/node_modules/verror/node_modules
npm WARN @verdaccio/types@5.0.0-beta.4 requires a peer of @types/node@10.12.18 but none is installed. You must install peer dependencies yourself.
npm WARN @verdaccio/types@5.0.0-beta.4 requires a peer of typescript@3.2.4 but none is installed. You must install peer dependencies yourself.
npm WARN @verdaccio/types@5.0.0-beta.4 requires a peer of flow-bin@0.90.0 but none is installed. You must install peer dependencies yourself.
npm WARN babel-loader@8.0.5 requires a peer of webpack@>=2 but none is installed. You must install peer dependencies yourself.

npm ERR! path /opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams'
npm ERR!  { [Error: EACCES: permission denied, access '/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path:
npm ERR!    '/opt/verdaccio/node_modules/@verdaccio/local-storage/node_modules/@verdaccio/streams' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     /opt/verdaccio/.npm/_logs/2019-06-05T06_31_18_008Z-debug.log

To Reproduce
Steps to reproduce the behavior:

  1. use amazon-s3-docker-example
  2. change FROM: verdaccio/verdaccio:4
  3. $ docker-compose up --force-recreate --build --always-recreate-deps
  4. See error

hi @yansenlei

That example was based on version 3 ((latest), which now is v4

https://github.com/verdaccio/verdaccio/releases/tag/v4.0.0

I updated the Docker file to v3, it should works now, to convert to v4 remember we have some breaking changes

https://github.com/verdaccio/docker-examples/blob/master/amazon-s3-docker-example/s3Plugin/Dockerfile

Thanks for reporting.

commented

@juanpicado
Please, Can update the example support version 4.0?

I will put it in my todo list :)

commented

Thanks!

To bypass the perms you can wrap the commands that needs to be root with:

FROM verdaccio/verdaccio:4.2.2
USER root
RUN npm i && npm i verdaccio-ldap
USER verdaccio

I have just run successfully the server with the LDAP plugin, I am now testing, the authentication work, see verdaccio/verdaccio#1476 to follow.

Don't forget --unsafe-perm for npm.

Thanks for the tip I didn't know that one.

I have just tried to run it without using root and that doesn't work in the Dockerfile, I still have EACCESS: permission denied