-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Provide guidance for using update-ca-certificates
in distroless images
#5045
Comments
Slightly related: #4997 |
Hi @lbussell In my company, I do prefer mounting the certificate as a volumeMount instead of integrating it in the container image. Below an example of my Deployment manifest :
The certificate is stored in a common keyvault and mounted as a volume in all my deployments. This way, I can update the certificate in the keyvault once, restart all deployments and voilà ! Let me know, if my answer is not clear. |
So you install the certificates with |
No, I don't setup the certificate on the machine with What I do:
If you don't have such a system, you can put the certificate file in a folder and mount it into the container to the path I mentioned in my previous comment. Marc |
I don't recall the exact problem, but my recollection says the above method did not work for all cases. I do use exactly the same approach, however some certs had to be 'installed'. |
We encountered the same issue. Chiseled images seem to work for us, save the custom certificate.
This is used for interfaces to other services within the company. So another team has a HTTPS endpoint that uses this internal cert and we want to do HTTPS requests to that service. Is there a way to make this work in a chiseled container? |
You can also run |
I think I got it to work and I'm happy to share my solution. Previously I had a Dockerfile like this:
Now, if I change the second stage to chiseled, the update-ca-certificates shell script won't work.
I guess the important bit is to know which folders are modified by running the tool. |
I think the key would be @richlander and @jfheins to find a solution where the certificates are not baked into the image. That seems to be rather an anti-pattern. |
Baking in can work fine if the lifetime of the cert is way longer than your release cycle. |
Not a big deal, but it probably makes sense to use one distro for both stages. You are using a combination of Debian and Ubuntu. There are two options:
I'm assuming the The volume mounting approach is the most secure and reliable. Context: https://manpages.ubuntu.com/manpages/xenial/man8/update-ca-certificates.8.html |
Potentially related: dotnet/aspnetcore#56582 |
This should be fixed by canonical/chisel-releases#266 in the next Chisel release. |
Are you saying that we should add the |
I'm not making any statement about servicing releases. Just indicating that a fix for this is incoming from Chisel. |
Describe the Problem
Our Ubuntu Chiseled images only includes the ca-certificates_data slice, which excludes tools like
update-ca-certificates
in order to reduce image size (this utility isn't typically needed at container runtime). However, if users want to add certificates at container build time, there's no documented way to do so in Ubuntu Chiseled.Describe the Solution
There should be a documented way to run the
update-ca-certificates
tool in the image's build layer, and copy the results to the runtime layer.Other Information
Context: https://devblogs.microsoft.com/dotnet/announcing-dotnet-chiseled-containers/comment-page-2/#comment-20182
The text was updated successfully, but these errors were encountered: