-
Notifications
You must be signed in to change notification settings - Fork 125
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
Improved Docker image + publish on ghcr.io
#642
base: master
Are you sure you want to change the base?
Conversation
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.
Looks good to me! I'd merge this after hearing @shssoichiro's thoughts about setting up the GitHub container registry for this repository. Great work on the documentation, Dockerfile and workflow. Thank you.
That said, as I mentioned in #610, I'm curious about what value these Docker images provide over the portable musl
binaries. I understand that Docker images are often requested for CLI tools, and that’s fine, but why exactly in this case? What specific problem does this solve for you?
Edit: I've just rebased your PR on top of the latest mainline commits to fix unrelated Clippy lint issues, please don't mind it 👍
- Cross-compilation support (amd64 + arm64) - Use cargo build cache - Add opencontainers labels
- Enable GitHub Actions Docker build cache - Disable build cache for tags - Allow running on dispatch without cache - Push to ghcr.io on master branch and tags - Publish build provenance attestation
fccae39
to
13ce891
Compare
I don't have a really specific usecase, I did this PR mostly as a training for both Docker and Rust 😅 (I use the tool with Anyways, I think the benefit of a Docker container over the portable binary is that you don't need to go to the download page, extract the binary and then go back regularly to check if there is any new version. |
Thanks for the comment @AFCMS, I do indeed realize now that the convenience of unifying software distribution through Docker containers can be valuable. Let's wait a bit for Josh's view on using GitHub Packages before merging 🚀 |
I wonder if it would be better for someone to maintain this externally from the main repo... |
I think it's more discoverable and official-looking to use the same repository both for Docker images and development, but anyone is free to create a repository for hosting their own OxiPNG Docker images of course. |
Fix #610
linux/amd64
andlinux/arm64
supported and tested (Tier 1 platform support from Rust)I also changed the WORKDIR from
/src
to/work
, because if got me confused with the use of the src folder for the project source in the first stage of the Dockerfile. It doesn't impact anything anyways since you can mount the file where you want and have the program options point to it.How to test?
After checking out the branch and making sure you have QEMU installed to build/test
For the workflow, see the GitHub Actions logs. If you want to test the ghcr.io publishing you can merge the branch into a fork and see the result.