Add docker image
Right now, the cargo-deny-action repo uses a dockerfile for the action, but this means that it gets built from scratch every time, which is inefficient, even if takes <30s, instead, we should publish an image to the Github Container Registry for every version of cargo-deny that it can use instead.
Yup that would be a good improvement, I was a bit surprised they didn't have a more integrated / automatic way of doing this for actions. But should be possible to do manually
I'm not sure this would be the best path. Right now, the Dockerfile is using rust:1.47-alpine3.12 as the base. Although it's Alpine, it's still a 200 MB image. When the full image is built, it ballons to 630 MB. Granted, there is compression in the download, but that would still be a long download, and likely take the same amount of time as in the current build.
I believe there is a much better option however. Since you are just running an executable, you don't actually need Rust to be installed in the Docker image. So I changed the base image to alpine:3.12, and made a PR on the cargo-deny-actions repo. The build time for the image should improve to only be a few seconds, as it is only downloading and decompressing the executable.
I could be mistaken about what requirements are needed for the executable to run, but this is how we run our Rust-compiled Veloren server. I'd be happy to discuss more if there are any other Docker issues :smile:
Actually scratch that, I came across this issue. I'll see if I can still think of a better way to go about it...
I would love to just use a minimal alpine base, unfortunately https://github.com/EmbarkStudios/cargo-deny/issues/295 blocks that right now.
:laughing: ya this is indeed turning out to be a very deep rabbit hole