I\'m using docker version 1.10.1 on RHEL 7 and getting npm install error when using below Dockerfile. The Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:
I was following a tutorial. This error doesn't happen for me when I copy all my files:
# Specify base image
FROM node:alpine
WORKDIR /usr/app
# Install dependencies
COPY ./ ./
RUN npm install
# Default command
CMD ["npm", "start"]
It happens with me when I copy package.json
first and then copy other files after npm install
:
# Specify base image
FROM node:alpine
WORKDIR /usr/app
# Install dependencies
COPY ./package.json ./
RUN npm install
COPY ./ ./
# Default command
CMD ["npm", "start"]