I have Docker Desktop on Windows 10 but using WSL 2 Ubuntu distro. I am behind a company vpn Anyconnect and before hand I was getting unable to get local issuer certificate
errors when I would run npm ci
via the terminal.
I set my export ENV NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt
and npm config set cafile /etc/ssl/certs/ca-certificates.crt
it started working and can now run npm ci
from the Ubuntu terminal.
However, when I run docker compose build
I am getting the same errors as before when it hits the npm ci
part of the Dockerfile.
I have tried adding this to my Dockerfile: ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/my-ca.crt
I tried sudo apt-get install ca-certificates
and tried to follow Docker in WSL - unable to get local issuer certificate
Main part of the error: ERR! install request to https://node-precompiled-binaries.grpc.io/grpc-tools/v1.13.0/linux-x64.tar.gz failed, reason: unable to get local issuer certificate
Essentially npm ci works from my WSL2 Ubuntu terminal but not from Docker which uses WSL 2 Ubuntu distro