Docker Compose TLS installation failed

[root@VM-0-9-centos docker-compose]# pwd
/root/docker-compose
[root@VM-0-9-centos docker-compose]# ./tls/run-tls.sh

The following error occurred

Step 4/4 : RUN update-ca-certificates
 ---> Running in 626b030fdc69
Failed to open temporary file /etc/ssl/certs/bundleXXXXXX for ca bundle
The command '/bin/bash -c update-ca-certificates' returned a non-zero code: 1
ERROR: Service 'temporal-admin-tools' failed to build

What user are you running as, does it have permission to read from /etc/ssl/certs/?

By adding the USER root configuration, the problem is resolved.

@baxiaoshi can you explain a bit more how you solved this? I’m running into the same issue. How/where did you add a user root configuration, i.e. how can I replicate your fix.

Edit:

It looks (possibly) like you did something like this (adding a USER root):

ARG BASEIMAGE
FROM temporalio/${BASEIMAGE}

USER root

COPY ./.pki/ca.pem /usr/local/share/ca-certificates/ca.crt

RUN update-ca-certificates