You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FROM node:20.11.1-alpine3.19
# Add our local certificate to the trusted store# COPY src-root.crt /usr/local/share/ca-certificates/COPY src-sub.crt /usr/local/share/ca-certificates/
COPY git-csm.example.com.crt /usr/local/share/ca-certificates/
# Update the trusted store (https://stackoverflow.com/a/67232164)# RUN cat /usr/local/share/ca-certificates/src-root.crt >> /etc/ssl/certs/ca-certificates.crt && \RUN cat /usr/local/share/ca-certificates/src-sub.crt >> /etc/ssl/certs/ca-certificates.crt && \
cat /usr/local/share/ca-certificates/git-csm.example.com.crt >> /etc/ssl/certs/ca-certificates.crt && \
apk --no-cache add curl git
# Setup node variables to respect the trusted storeENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/git-csm.example.com.crt
ENV NODE_OPTIONS=--use-openssl-ca
Inside the image curl works normally (cert is correctly added to the local store)
curl https://git-csm.example.com
<html><body>You are being <a href="https://git-csm.example.com/users/sign_in">redirected</a>.</body></html>f5136286dd66:/#
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
When running custom dockerfile
Inside the image curl works normally (cert is correctly added to the local store)
But using the following code:
I ran into the error
Any ideas what am I doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions