Skip to content
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

Add a slim Docker image for testing #1630

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MrAlias
Copy link
Contributor

@MrAlias MrAlias commented Jan 15, 2025

For testing purposes we only need the auto-instrumentation code (not tests, examples, docs, etc.). Add an equivalent Dockerfile to the base one that will exclude all these extraneous items.

@MrAlias MrAlias force-pushed the slim-test-img branch 2 times, most recently from 970d9f7 to 3171ea9 Compare January 15, 2025 20:38
@MrAlias MrAlias marked this pull request as ready for review January 15, 2025 21:13
@MrAlias MrAlias requested a review from a team as a code owner January 15, 2025 21:13
Copy link
Contributor

@RonFed RonFed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have a reason to include examples/tests/licenses in the main image?
All those exclusions looks valid to me also for the main image

.github/workflows/kind.yml Show resolved Hide resolved
@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 16, 2025

Do we have a reason to include examples/tests/licenses in the main image? All those exclusions looks valid to me also for the main image

I guess the final image is just a thin distroless base image with the binary copied to it. No reason to copy everything there.

That said, I think we do need to update our final image to contain the licenses for legal reasons.

I can look into updating.

For testing purposes we only need the auto-instrumentation code (not
tests, examples, docs, etc.). Add an equivalent Dockerfile to the base
one that will exclude all these extraneous items.
@MrAlias
Copy link
Contributor Author

MrAlias commented Jan 17, 2025

Do we have a reason to include examples/tests/licenses in the main image? All those exclusions looks valid to me also for the main image

I plan to address this in a separate PR. The test Dockerfile is distinct enough in that it does not generate builds for non-native architectures that it cannot be unified into a single image.

I plan to move forward with adding a separate test image and clean up the main build image.

@RonFed
Copy link
Contributor

RonFed commented Jan 17, 2025

@MrAlias generating the ebpf .go and .o files inside a container has a big advantage that is produces a consistent result. It is also recommended by the cilium ebpf library.

Regardless of this, what is the motivation to generate the files outside of the container? Is it to save time in the tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants