Skip to content

chore: when using ubuntu, use hardened intermediate container#359

Open
kristof-mattei wants to merge 6 commits intodrahnr:mainfrom
kristof-mattei:hardened-image
Open

chore: when using ubuntu, use hardened intermediate container#359
kristof-mattei wants to merge 6 commits intodrahnr:mainfrom
kristof-mattei:hardened-image

Conversation

@kristof-mattei
Copy link
Copy Markdown
Contributor

@kristof-mattei kristof-mattei commented Mar 16, 2026

What does this PR accomplish?

  • 🪣 Misc

Changes proposed by this PR:

Use a hardened image when testing & building.

Notes to reviewer:

Running as is Chainguard's sanctioned way to install packages: https://edu.chainguard.dev/chainguard/chainguard-images/about/differences-development-production/#:~:text=Chainguard%20Containers%20use,packages%20with%20apk.

📜 Checklist

  • Works on the ./demo sub directory
  • Test coverage is excellent and passes
  • Documentation is thorough

@kristof-mattei
Copy link
Copy Markdown
Contributor Author

@drahnr sorry to ping you. Anything else you'd like me to add here?

@drahnr
Copy link
Copy Markdown
Owner

drahnr commented Mar 25, 2026

One small ask: I'd like to see if the binary produced has runtime deps, specifically on libonig - a simple step of ldd -v $binary would be sufficient.

Thank you!

Otherwise, LGTM

@kristof-mattei
Copy link
Copy Markdown
Contributor Author

Will do.

@kristof-mattei
Copy link
Copy Markdown
Contributor Author

@drahnr used readelf because that one was available.

This actually made me realize we were linking it dynamically. Had to downgrade the C standard to make it work.

Also removed the caching mechanism because that didn't work.

Log output on that:

  ... Cleaning /__w/cargo-spellcheck/cargo-spellcheck/target ...
  ... Cleaning cargo registry (cache-all-crates: false) ...
  ... Cleaning cargo/bin ...
  ... Cleaning cargo git cache ...
  ... Saving cache ...
  /usr/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/cargo-spellcheck/cargo-spellcheck --files-from manifest.txt -z
  /usr/bin/tar: unrecognized option '--posix'"

CI will fail if dynamically linked
... Cleaning /__w/cargo-spellcheck/cargo-spellcheck/target ...
... Cleaning cargo registry (cache-all-crates: false) ...
... Cleaning cargo/bin ...
... Cleaning cargo git cache ...
... Saving cache ...
/usr/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /__w/cargo-spellcheck/cargo-spellcheck --files-from manifest.txt -z
/usr/bin/tar: unrecognized option '--posix'
@kristof-mattei
Copy link
Copy Markdown
Contributor Author

kristof-mattei commented Mar 26, 2026

@kristof-mattei kristof-mattei deleted the hardened-image branch March 27, 2026 19:45
@kristof-mattei kristof-mattei restored the hardened-image branch March 27, 2026 19:46
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