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

Build the skupper-router image from scratch #1728

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

skitt
Copy link
Contributor

@skitt skitt commented Jan 29, 2025

This uses a separate "packager" stage to install only the required packages, with nothing else. This produces an image:

  • with no extraneous packages
  • with no content in base layers
  • with no package manager
  • that can still be processed by security scanning tools

Image size is reduced from 226MiB to 129MiB.

This uses a separate "packager" stage to install *only* the required
packages, with nothing else. This produces an image:
* with no extraneous packages
* with no content in base layers
* with no package manager
* that can still be processed by security scanning tools

Image size is reduced from 226MiB to 129MiB.

Signed-off-by: Stephen Kitt <[email protected]>
@skitt
Copy link
Contributor Author

skitt commented Jan 29, 2025

FYI @ganeshmurthy — note that this will fail if other packages in the base image are used without being declared. This also has no labels, if any of the base image labels are necessary they will have to be copied across.

@jiridanek
Copy link
Contributor

jiridanek commented Jan 29, 2025

@ganeshmurthy I don't have any experience with this, actually. I just saw that comment on

and thought that it sounds interesting and might just work.

Looks like the approach has been around a long time and semi-official Red Hat blogs mention it, so it should not cause too many unexpected problems.

FYI @ganeshmurthy — note that this will fail if other packages in the base image are used without being declared.

That's one problem, but there was the same problem already before, if something was installed into the builder image but it was forgotten to install the non-devel pkg version into the run image.

I'm tempted to actually check for myself if this helped with image size any, compared to the microdnf uninstall.

@ganeshmurthy
Copy link
Contributor

ganeshmurthy commented Jan 29, 2025

I'm tempted to actually check for myself if this helped with image size any, compared to the microdnf uninstall.

Main image size is 230 MB and the image from this PR is 129MB

Copy link
Contributor

@jiridanek jiridanek left a comment

Choose a reason for hiding this comment

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

wow, so much smaller? if it works, ship it!

edit: just noticed the size info in the PR description : facepalm :

@ganeshmurthy ganeshmurthy merged commit ae494a1 into skupperproject:main Jan 29, 2025
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants