Allow certs to be include in an image #97
Merged
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.
Summary
Prior to this PR, a helper is added at build time. This helper will execute in the runtime environment and load any ca-certs that are presented through a binding. This is the most flexible, but requires the individual executing the image to specify the binding with the CA certificates. If the CA certificates binding is skipped/forgotten, then the run will likely fail.
Since CA certificates are public certificates and not secret, we can build the CA certificates into the image if the user would prefer. This provides the CA certificates by default, so there is no ca-certificates binding required at runtime. You can add additional CA certs at runtime with a binding, but you cannot remove CA certs baked into the image without rebuilding.
To include in the image, set
BP_EMBED_CERTS=true
and rebuild your image.CA certificates are copied into the layer. Then the normal symlinking procedure is applied referencing the copies.
This resolves #94.
In addition, this PR deprecates
BP_ENABLE_RUNTIME_CERT_BINDING
because this has a defaulttrue
value and we are moving all config to be defaultfalse
. This env variable is replaced byBP_RUNTIME_CERT_BINDING_DISABLED
which defaults to false. The meaning is basically the same. Going forward, setBP_RUNTIME_CERT_BINDING_DISABLED=true
to remove the runtime helper from the produced image.Use Cases
#94
Checklist