Skip to content

Conversation

@brianaydemir
Copy link
Contributor

@brianaydemir brianaydemir commented Dec 28, 2025

This PR makes two improvements to our container images.

The primary improvement is to entrypoint.sh, which now scans /certs for certificates (*.crt files) and adds them to the container's trust store, assuming their extendedKeyUsage includes serverAuth (see also: OpenSSL's documentation). During development and testing, this should help minimize, if not eliminate, the need to resort to TLSSkipVerify: true or similar, especially for those programs that might not be aware of Pelican's configuration (e.g., curl).

Note

There is hypothetically a backwards compatibility concern given that I chose to scan /certs based on where We™ currently seem to bind mount certificates into containers. That said, I would find it passing strange for a container to mount a certificate it doesn't trust but presumably expects the rest of the world to trust.

The secondary improvements are to the container image build process (the Dockerfile), which are intended to facilitate repeated image builds by improving layer caching and not building unnecessary binaries.

@brianaydemir brianaydemir added this to the v7.23 milestone Dec 28, 2025
@brianaydemir brianaydemir added enhancement New feature or request internal Internal code improvements, not user-facing container labels Dec 28, 2025
@brianaydemir brianaydemir linked an issue Dec 28, 2025 that may be closed by this pull request
'graphviz' is necessary for some of `go tool pprof`'s visualizations.

'psmisc' includes `killall`, which is useful for cleaning up after
accidental mass-invocations of some command, such as the file transfer
plugin.
@brianaydemir brianaydemir force-pushed the container-improvements branch from 8f37e40 to c50c8cf Compare December 29, 2025 14:27
@brianaydemir
Copy link
Contributor Author

For testing, I've been using something like the following framework:

Of special note is the ./certs/.init.sh script, which provides an example how to create and use a CA. (You'll probably want to modify environment.cfg to refer to your own container images.)

Once you've got the containers up and running, you can try things like:

# Check for errors in the entrypoint script.
$ docker logs pelican-director-1 2>&1 | less

# Check whether we need to skip certificate validation.
$ docker exec -it pelican-director-1 bash -il
[root@director pelican]# curl https://registry:8444/
<a href="/view/">Found</a>.

[root@director pelican]# curl https://origin-0:8444/
<a href="/view/">Found</a>.

[root@director pelican]# curl https://cache-0:8444/
<a href="/view/">Found</a>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

container enhancement New feature or request internal Internal code improvements, not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable containers to add CAs to the trust store on start up

2 participants