0

Trying to install resume-cli through docker but getting some permission errors on installing resume-cli.

Dockerfile:

FROM python:3.7-slim-buster

RUN apt-get update
RUN apt-get install -y curl

SHELL ["/bin/bash", "--login", "-c"]

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
RUN nvm install 15.13.0

RUN npm install -g resume-cli --unsafe-perm=true --allow-root
RUN npm install -g jsonresume-theme-paper

and i run: docker build -t containernpm .

where I get Error on RUN npm install -g resume-cli --unsafe-perm=true --allow-root:

npm ERR! code 127
npm ERR! path /root/.nvm/versions/node/v15.13.0/lib/node_modules/resume-cli/node_modules/puppeteer
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! sh: 1: node: Permission denied 

btw next line RUN npm install -g jsonresume-theme-paper (with -g) runs normally without permission error.

Any idea how to overpass that without removing -g on RUN npm install -g resume-cli --unsafe-perm=true --allow-root ? (by removing -g runs without error)

Mpizos Dimitris
  • 4,819
  • 12
  • 58
  • 100
  • 1
    Can it be that you need to say ```USER root``` before that commend and then set user back to what is was before? I guess you can get that user with ```RUN whoami```. – Kaj Hejer Apr 02 '21 at 19:47

1 Answers1

0

I can't say I know why the permissions errors are happening, but here is a Dockerfile that works.

FROM node:15.13.0-buster-slim
RUN npm install -g resume-cli
ENTRYPOINT ["resume"]

There is a related question (sh: 1: node: Permission denied) but the top-voted answer there does not work for me.

jkr
  • 17,119
  • 2
  • 42
  • 68