To get docker
and yarn
working on my corporate network, I needed to add a CA certificate to trust store (for docker) and set NODE_EXTRA_CA_CERTS
for yarn
(see here). The Dockerfile
for my react application includes yarn install && yarn run build
which gives a "self signed certificate in certificate chain" error. I am able to get around the error by running yarn install
on my local machine before building in docker, remove yarn install
from my Dockerfile
and remove node_modules
from my .dockerignore
file.
How should I be resolving this error? Should I be transferring the .pem
CA file to the Docker container and adding set NODE_EXTRA_CA_CERTS
to the Dockerfile
?
Dockerfile
:
FROM node:15.13-alpine
WORKDIR /react
COPY . .
# RUN yarn config set cafile ./
RUN yarn install && yarn run build
.dockerignore
:
node_modules
build