0

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!

FullStack
  • 665
  • 11
  • 26
  • You say it produces an error, but then attached an image file instead of the error message. Can you [edit] the question to include the actual error message as text? You should rarely need to include a screen shot of a terminal window in a question, text-format code or error messages are almost always better. It'd also help to know which Dockerfile step is actually producing the error. – David Maze May 26 '22 at 13:04
  • Hi @DavidMaze Thanks, Updates reflected! – FullStack May 26 '22 at 13:26
  • **Please review:** [stackoverflow_link](https://stackoverflow.com/a/9631045/17903365) – Its_Dark_Here May 26 '22 at 13:53
  • @Its_Dark_Here Thanks for the response, Already tried that but doesn't work! – FullStack May 26 '22 at 16:03

0 Answers0