Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

One solution is to add the corporate root certificate to the Docker container's trust store. This can be achieved by:

  1. Obtaining the corporate root certificate (often available from the IT department)

  2. Creating a directory for the certificates in the Dockerfile:

    RUN mkdir -p /usr/local/share/ca-certificates/corporate
    
  3. Copying the root certificate into the directory:

    COPY corporate-root.crt /usr/local/share/ca-certificates/corporate/
    

    Note: replace "corporate-root.crt" with the actual name of the certificate file.

  4. Updating the certificate trust store:

    RUN update-ca-certificates
    

    This will update the certificates in /etc/ssl/certs/ca-certificates.crt.

This will ensure that the root certificate is trusted by the Docker container and npm should no longer have issues obtaining the issuer certificate.