0

Please help me out to fix this error while building a docker image using this command,

docker build -t my-first-app .

My Dockerfile content is

FROM alpine
LABEL maintainer="aamirpinger@yahoo.com"
RUN apk add --update nodejs nodejs-npm
COPY . /src
WORKDIR /src
RUN npm install
ENV CREATEDBY="Amir Pinger"
EXPOSE 8080
ENTRYPOINT ["node", "./app.js"]

1 Answers1

0

From this question:

For the recent versions of Alpine (v3.8+) the correct way to install nodejs with npm is:

apk add --update nodejs npm

However, npm package depends on nodejs, so you can do:

apk add --update npm

Note: since Alpine 3.8 there is no nodejs-npm package.