-
Notifications
You must be signed in to change notification settings - Fork 58
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
Adding release Dockerfiles #601
Conversation
Very nice. Some time ago I did one for openSUSE: https://build.opensuse.org/package/show/devel:microos:containers/rust-keylime-image Maybe we can find some common rules |
Nice! I like the podman labels and volumes, healthcheck and stopsignal definitions. As I was writing this with Kubernetes in my mind, I did not consider any of these. As they are not mutually exclusive though, they should be included imho. I'll try to incorporate those. |
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 suggested some changes to reduce the fedora-based image, basically using fedora-minimal
as the base image.
With this change, I get:
REPOSITORY TAG IMAGE ID CREATED SIZE
localhost/keylime_agent latest 9c9c97702d63 17 minutes ago 124 MB
/packit retest-failed |
This is great stuff! When I put together my Dockerfiles, I had a slightly different use case in mind as my goal was primarily to support our internal KL development efforts at HPE. Distroless release images were at the back of my mind as a stretch goal that I just never got around to. So I am really happy to see this PR! I've had a look through the files and had some notes/queries:
|
thanks! 👍
I'm pretty sure they can be removed (actually very certain). The base for the Fedora builder stage was copy&pasted from the existing Dockerfile. I have to admit that I did not carefully review everything that gets installed there. Good catch!
Yes, I like that. Good point!
Tbh, I never even heard of Chainguard/Wolfi before. I will definitely check it out. The idea here was to propose several files and discuss it with the community. Also, it's not uncommon for some projects to provide multiple tags with different base images. What I like about the distroless images is that they are "as open as it gets" from an Open Source perspective. And they are well respected as base images in the Kubernetes community. From a quick look at the links you provided it is definitely worth looking into Chainguard/Wolfi and also have an option for that. I like the SBOMs and cosign/sigstore signatures for sure. It's very much aligned with what we are doing at Hedgehog ourselves.
Yeah, no need to template it just because of that. |
Codecov Report
Additional details and impacted files
Flags with carried forward coverage won't be shown. Click here to find out more. |
The images now work like this tested with the Helm charts in: keylime/attestation-operator#13 The Rust Static code check currently fails with a security vulnerability check problem: openssl needs to be upgraded! Should I do this just in this PR, or create a separate one for that? |
There is one open already by dependabot: #605 |
# define the stopsignal to be SIGINT like the systemd service file does | ||
STOPSIGNAL SIGINT |
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.
With #613, this should not be necessary anymore
# define the stopsignal to be SIGINT like the systemd service file does | ||
STOPSIGNAL SIGINT |
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.
With #613, this should not be necessary anymore
# define the stopsignal to be SIGINT like the systemd service file does | ||
STOPSIGNAL SIGINT |
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.
With #613, this should not be necessary anymore
@mheese Could you please rebase this? |
Signed-off-by: Marcus Heese <[email protected]>
This PR aims to add a Dockerfile for a release version of the rust keylime agent.
This is a work-in-progress at this point. It is being discussed in the keylime-operator slack channel.
It currently contains a local build script like in the main keylime repository. Also, it contains different versions which have their advantages/disadvantages that we should discuss:
Dockerfile.distroless
: an absolute bare minimum container which does not even have a shell. It is based on the "distroless" container effort from Google (which for example forms the base images for a couple of bigger projects like Kubernetes)Dockerfile.wolfi
: also a bare minimum container which does not even have a shell. It is based on the wolfi container distribution from Chainguard which in turn was inspired by Google's distroless and ko projects. Its focus is a dedicated container distribution which heavily focuses on security, frequent updates and updates faster/more often than distrolessDockerfile.fedora
: is based on Fedora 38. This is a "fat" image, but both the build stage as well as the assembly stage are based upon Fedora 38. This is probably closer to what we know works.Here a comparison of the two versions:
Dockerfile.distroless
gcr.io/distroless/cc
as a base image which is a minimal no-shell base image including C runtime dependencies (libc, libgcc, etc.) as well as OpenSSL and root CA certificates. This image is intended for use by languages like Rust or D according to its documentationPros of this approach are IMHO:
Cons of this approach are IMHO:
image size:
Dockerfile.wolfi
cgr.dev/chainguard/cc-dynamic
as a base image which is a minimal no-shell base image including C runtime dependencies (libc, libgcc, etc.). This image is intended for use by languages like Rust even according to Chainguard's rust image documentationPros of this approach are IMHO:
Cons of this approach are IMHO:
image size:
Dockerfile.fedora
Pros of this approach are IMHO:
Cons of this approach are IMHO:
image size: