-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dockerTools ca-certificates.crt helper #170906
Conversation
@@ -773,6 +773,11 @@ rec { | |||
ln -s ${bashInteractive}/bin/bash $out/bin/sh | |||
''; | |||
|
|||
# This provides /etc/ssl/certs/ca-certificates.crt | |||
caCertificates = runCommand "ca-certificates" { } '' | |||
ln -s ${cacert}/etc/ssl/certs/ca-bundle.crt $out/etc/ssl/certs/ca-certificates.crt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the cacert
package already provided the extra symlink. Wouldn't it be simpler to add it there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The symlinks are setup by the nixos ca module. If the package provided the symlinks itself, it wouldn't be of much help, since they would still be under the full store path, wouldn't they? It would work with the docker specific use case, since the image builders create the symlinks at the root directory, but eg for NixOS you'd still need the extra logic outside the package to provide the links.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The whole premise of this is that non-store paths are created at the container root from the paths below store paths, but you're right. What I was suggesting would run the risk of duplicating store paths. There's too many ways to add stuff and we should probably use the module system to take care of this stuff anyway. (poc: #148456). Your derivation will be helpful in the meanwhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this provide both names, like NixOS does? ca-bundle.crt
and ca-certificates.crt
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ca-bundle.crt
is the name of the bundle in $out
of cacert, so it's already set up by the dockerTools symlink. We might want to add the other symlink from the ca module for Fedora compatibility though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait it isn't. Nvm. We should add it.
@@ -773,6 +773,11 @@ rec { | |||
ln -s ${bashInteractive}/bin/bash $out/bin/sh | |||
''; | |||
|
|||
# This provides /etc/ssl/certs/ca-certificates.crt | |||
caCertificates = runCommand "ca-certificates" { } '' | |||
ln -s ${cacert}/etc/ssl/certs/ca-bundle.crt $out/etc/ssl/certs/ca-certificates.crt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this provide both names, like NixOS does? ca-bundle.crt
and ca-certificates.crt
.
Various tools (e.g. wget) expect the ca bundle to be available at /etc/ssl/certs/ca-certificates.crt
5c17f7c
to
f93491a
Compare
Anything left to do here? @roberth |
Some packages expect certain files to be available globally. | ||
When building an image from scratch (i.e. without `fromImage`), these files are missing. | ||
`pkgs.dockerTools` provides some helpers to set up an environment with the necessary files. | ||
You can include them in the `contents` like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contents
has changed to copyToRoot
. Otherwise lgtm.
d7bcb84
to
c9d8e34
Compare
What's missing to get this merged? |
Description of changes
Add a helper to install
ca-bundle.crt
in containers built withdockerTools
at/etc/ssl/certs/ca-certificates.crt
, where different programs such aswget
look for them.Add documentation.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes