verdaccio / verdaccio-audit

🛡🔬verdaccio plugin for npm audit support

Home Page:https://www.verdaccio.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to install plugin into docker container

SkeLLLa opened this issue · comments

commented

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.

commented

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!!