Dockerfile uses "npm install" in a build step, but npm run in CMD fails

Viewed 45

This is my Dockerfile

FROM debian:9

RUN apt-get update -yq \
&& apt-get install curl gnupg -yq \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash \
&& apt-get install nodejs -yq \
&& apt-get clean -y

ADD . /app/
WORKDIR /app
RUN npm install

EXPOSE 2368
VOLUME /app/logs

CMD ["npm", "run". "start"] 

Now

docker build -t d_npm  .

it compile with no errors

But

docker run -d -p 2368:2368   d_node

fails with this message

docker: Error response from daemon: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "npm": executable file not found in $PATH: unknown.

How to fix this ?

0 Answers
Related