You are probably all using a "very old" build stack based on older node docker images, which use older Debian distribution for its base image (i.e. node:6
=> Debian Stretch).
It seems that the letsencrypt certificate of registry.bower.io was updated on 24th April, 2023 and since then uses a more modern intermediate certificate. This was not available/known in older Debian distributions on which the original node images were based.
Of course its about time to upgrade your stack, but in the meanwhile you could use these workarounds.
Add this to your Dockerfile, just before you are doing the bower install
as a workaround:
If using node:6
/ Debian Strech
# manually remove expired letsencrypt X3 certificate and install the new ISRG X1 root CA
RUN mkdir -p /usr/share/ca-certificates/letsencrypt/ \
&& cd /usr/share/ca-certificates/letsencrypt/ \
&& curl -kLO https://letsencrypt.org/certs/isrgrootx1.pem \
&& perl -i.bak -pe 's/^(mozilla\/DST_Root_CA_X3.crt)/!$1/g' /etc/ca-certificates.conf \
&& update-ca-certificates
Then use this flag to tell bower to use the system wide CA system:
RUN NODE_OPTIONS=--use-openssl-ca bower install ...
If using node:4
/ Debian Jessie
Not possible to get this ancient npm to use openssl-ca's, so just disable SSL check in the case:
RUN <<EOR
cat <<EOF > .bowerrc
{
"registry": "https://registry.bower.io",
"strict-ssl": false,
"https-proxy": ""
}
EOF
EOR