docker build failed on npm install, reason: connect ECONNREFUSED 104.16.17.35:443

  docker, node.js, ubuntu

I’m having a hard problem getting my Docker container up, it shows some weird error in the console, I’m zero clues about it as I’m a newbie:

Dockerfile:

FROM node:14

WORKDIR /usr/src/app/

COPY package.json package.json
COPY server.js server.js

RUN ping -c 4 google.com
RUN  npm config set registry https://registry.npmjs.com/
RUN echo "${http_proxy}" && echo "${HTTP_PROXY}" 

RUN npm install
# COPY . .

EXPOSE 3000

CMD ['npm', 'start']

When I run the docker build command

$ docker build -t myapp .

The error I’m getting:

enter image description here

enter image description here

I’m on Ubuntu 20.4 and it is just a simple node app with a server.js file. let me know if you need anything else from me to get it fixed. Thank you in advance for your help!

Source: Docker Questions

LEAVE A COMMENT