Ask Your Question
2

How can I solve the issue of npm not being able to obtain the issuer certificate locally when using a Dockerfile behind a corporate firewall?

asked 2021-11-18 11:00:00 +0000

bukephalos gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-05 17:00:00 +0000

pufferfish gravatar image

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-11-18 11:00:00 +0000

Seen: 8 times

Last updated: Oct 05 '22