I'm trying to simply generate the docker image using docker build --no-cache -t /testspace:v1 . on Windows10 OS, the build fails with following error of self signed certificate at npm install. Please take a look at Error appeared below,
=> ERROR [ui-build 7/8] RUN npm install 259.0s
------
> [ui-build 7/8] RUN npm install:
#12 258.9 npm ERR! code DEPTH_ZERO_SELF_SIGNED_CERT
#12 258.9 npm ERR! errno DEPTH_ZERO_SELF_SIGNED_CERT
#12 258.9 npm ERR! request to https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz failed, reason: self signed certificate
#12 259.0
#12 259.0 npm ERR! A complete log of this run can be found in:
#12 259.0 npm ERR! /root/.npm/_logs/2022-05-26T13_03_41_772Z-debug-0.log
------
executor failed running [/bin/sh -c npm install]: exit code: 1
Following is my docker file,
FROM alpine:latest AS ui-build
RUN apk -v --no-cache --update add nodejs npm
WORKDIR /usr/app/client
COPY client/package-lock.json client/package.json ./
COPY client/src/ ./src
COPY client/public/ ./public
RUN npm install
RUN npm run build
FROM alpine:latest AS server-build
COPY --from=ui-build /usr/app/client/build /usr/app/server/ui-sources
WORKDIR /usr/app/server
COPY server/package-lock.json server/package.json ./
COPY ./server ./
RUN npm install
EXPOSE 8080
CMD node app-test.js
I'm sure that, i'm not behind any proxy, What could be the issue ?, I mean why for simple npm install in Dockerfile it asks for certificate ? However, the same Dockerfile works perfectly fine on other windows system.
Can it be related to Docker Desktop Version or anything else that i'm missing or can be fixed at my side ?
Thanks in advance!