I have this Dockerfile:
FROM node:argon
ENV http_proxy http://user:[email protected]:3128
ENV https_proxy https://user:[email protected]:3128
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . /usr/src/app
EXPOSE 8080
CMD [ "npm", "start" ]
But I get this error, in npm install step:
npm info it worked if it ends with ok npm info using [email protected] npm info using [email protected] npm WARN package.json [email protected] No description npm WARN package.json [email protected] No repository field. npm WARN package.json [email protected] No README data npm info preinstall [email protected] npm info attempt registry request try #1 at 7:09:23 AM npm http request GET https://registry.npmjs.org/body-parser npm info attempt registry request try #1 at 7:09:23 AM npm http request GET https://registry.npmjs.org/express npm info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=write EPROTO npm info retry will retry, error on last attempt: Error: tunneling socket could not be established, cause=write EPROTO
I guess it is due to the proxy. I have also tried to put
RUN npm config set proxy http://user:[email protected]:3128
RUN npm config set https-proxy http://user:[email protected]:3128
but still getting the same error.
Moreover, in my file /etc/systemd/system/docker.service.d/http-proxy.conf I have this:
Environment="HTTP_PROXY=http://user:[email protected]:3128"
Environment="HTTPS_PROXY=https://user:[email protected]:3128"
Thanks in advance.