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 tiny docker images #662

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

Conversation

JadedBlueEyes
Copy link
Contributor

@JadedBlueEyes JadedBlueEyes commented Jan 9, 2025

Appropriate semver, branch/PR and SHA tags are automatically generated, with the following suffixes:

  • -tiny: amd64 + arm64 generic builds
  • -tiny-haswell: amd64 haswell-optimised builds

Images are 24-30MB, and are tagged with metadata, build attestations, SBOM, etc.

  • Binaries are built against glibc. All linked-against dependencies are automatically copied into the runtime image.
  • Root certificates are also included.
  • ARM images are cross-compiled from the host (as compiling under QEMU can take over three and a half hours)
  • Additional architectures and CPU targets can be added by adding to the appropriate lists in the dockerfile and/or build matrix
  • The build process is cached as much as possible, typically taking ~10mins due to rocksdb. 20 mins with no cache, 3 mins if the entire build is cached by buildkit and cargo isn't called.
  • SOURCE_DATE_EPOCH is set, so builds should be reproducible as far as the build chains support that.

Possible enhancements:

  • Use clang as the C++ compiler and enable cross-language LTO
  • Smoke-test images before pushing the index / tags
  • Optimise binaries with cargo-pgo (would require a representative benchmark suite)

Todo:

Let me know if you want me to rebase the commit history to be a bit more sane.

@tcpipuk
Copy link
Contributor

tcpipuk commented Jan 9, 2025

I'm excited to see this, thanks for writing it!

I'd probably squash the commits though as it's purely modifying the CI 🙂

@JadedBlueEyes
Copy link
Contributor Author

Thanks! ❤️
I'd probably not squash all of them, as some are meaningful - like 7fc2e6a

@JadedBlueEyes
Copy link
Contributor Author

Commits rebased, from 26 to 9!

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.

2 participants