fix(image-spec): set NIX_SSL_CERT_FILE so nix can verify TLS in Docker builds - #57
Open
Feel-ix-343 wants to merge 1 commit into
Open
Feel-ix-343 wants to merge 1 commit into
Feel-ix-343 wants to merge 1 commit into
Conversation
…r builds The nix daemon inside the Docker builder could not verify SSL certificates when downloading fixed-output derivations (e.g., crate tarballs for importCargoLock). Although ca-certificates is installed via apt, nix does not automatically discover system CA bundles. Two changes: 1. Add ssl-cert-file to nix --extra-conf during install so the daemon configuration permanently knows where to find CA certificates. 2. Export NIX_SSL_CERT_FILE before sourcing nix-daemon.sh so the nix client also picks up the cert bundle for substituter access. Fixes minos2_rust build failure on depot remote builders: curl: (22) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20) error: cannot download crate-async-compression-0.4.34.tar.gz Co-Authored-By: Felix Zeller <felixazeller@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are the changes needed?
When building Docker images with
nix=Trueon depot remote builders, the nix daemon inside the Docker build container cannot verify SSL certificates when downloading fixed-output derivations (e.g., crate tarballs viaimportCargoLock). This causesminos2_rustand other Rust crate builds to fail:Although
ca-certificatesis installed via apt in theNIX_DOCKER_FILE_TEMPLATE, nix does not automatically discover system CA bundles — it needs explicit configuration.What changes were proposed in this pull request?
Two additions to
NIX_DOCKER_FILE_TEMPLATE:--extra-conf "ssl-cert-file = /etc/ssl/certs/ca-certificates.crt"during nix install — configures the nix daemon to permanently know where CA certificates live.export NIX_SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crtbefore sourcingnix-daemon.sh— ensures the nix client also picks up the cert bundle for binary cache / substituter access.Both point to the CA bundle provided by the
ca-certificatesapt package already installed earlier in the Dockerfile.How was this patch tested?
Verified that:
ca-certificatesapt package installs/etc/ssl/certs/ca-certificates.crton Ubuntu 24.04ssl-cert-filein nix.conf andNIX_SSL_CERT_FILEenv var for TLS verificationFull validation requires a depot build of exa_ml with minos2_rust — the fix targets that specific failure path.
Check all the applicable boxes
Link to Devin session: https://app.devin.ai/sessions/ab8a3bee55534c6cbb2d23f03da11f5f
Requested by: @Feel-ix-343