How to install plugin into docker container
SkeLLLa opened this issue · comments
Hi. I'm trying to install this plugin inside docker container based on verdaccio.
FROM verdaccio/verdaccio:latest
USER verdaccio
WORKDIR /verdaccio
COPY . .
# This will fail with EACCESS error
RUN npm i -g verdaccio-audit
EXPOSE 4873
VOLUME ["/verdaccio"]
npm i -g
fails with EACCESS error
Installing into app directory (npm i --prefix /usr/local/app) will break dependencies and verdaccio will not start
Installing into plugins directory also is tricky because it will need to build this module, cause it uses flow.
Is there any easy way to do that. Without using docker compose and so on.
Solved by swithcing to root
FROM verdaccio/verdaccio:latest
USER root
RUN npm i -g verdaccio-audit
USER verdaccio
WORKDIR /verdaccio
COPY . .
EXPOSE 4873
VOLUME ["/verdaccio"]
I will put that in our documentation thanks for sharing!!