1

I am building a custom Docker Image of a Node/Nextjs app that will be used in a CI/CD to Azure App Service behind a corporate proxy.

I am able to 'npm install' locally by setting up .npmrc so I am not getting SSL issues locally. Though when I am developing in the local Dockerfile , I receive 'npm ERR! Unable_to_get_issuer_cert_locally' during my 'RUN npm install'.

My question is how/what are the best practices for configuring node (with env variables) within an image/container behind a proxy so that I can develop locally and deploy to App Service via pipeline.

Blaike24
  • 23
  • 6
  • So your Azure CI/CD pipeline needs your corporation's SSL certificate, correct? Look here: https://stackoverflow.com/a/47163128/421195 – paulsm4 Aug 02 '23 at 14:59
  • My Azure pipeline needs it, but currently I'm working just locally and I need to pass the .npmrc configs used on my machine to my Dockerfile so that I can build the image using npm. – Blaike24 Aug 02 '23 at 15:04
  • SUGGESTION: instead of using "export", set "NODE_EXTRA_CA_CERTS" with "ARG" option in your Dockerfile: `ARG NODE_EXTRA_CA_CERTS=/etc/ssl/certs/ca-certificates.crt`. Look here: [npm UNABLE\_TO\_GET\_ISSUER\_CERT\_LOCALLY in docker behind corporate firewall](https://stackoverflow.com/questions/75898561/npm-unable-to-get-issuer-cert-locally-in-docker-behind-corporate-firewall) – paulsm4 Aug 02 '23 at 17:00
  • If you need "conditionals" in your DockerFile (to ensure it works both locally AND with your Azure pipeline), look here: https://stackoverflow.com/a/60820156/421195 – paulsm4 Aug 02 '23 at 17:07

0 Answers0