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

Add docker image #299

Open
Jake-Shadle opened this issue Oct 21, 2020 · 6 comments
Open

Add docker image #299

Jake-Shadle opened this issue Oct 21, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@Jake-Shadle
Copy link
Member

Jake-Shadle commented Oct 21, 2020

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.

@Jake-Shadle Jake-Shadle added the enhancement New feature or request label Oct 21, 2020
@repi
Copy link
Contributor

repi commented Oct 21, 2020

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

@AngelOnFira
Copy link

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 😄

@AngelOnFira
Copy link

Actually scratch that, I came across this issue. I'll see if I can still think of a better way to go about it...

@Jake-Shadle
Copy link
Member Author

I would love to just use a minimal alpine base, unfortunately #295 blocks that right now.

@AngelOnFira
Copy link

😆 ya this is indeed turning out to be a very deep rabbit hole

@paolobarbolini
Copy link

cargo-deny has been packaged in Alpine Linux a few months ago 1. It was initially included in their testing repository, as is done with every new package. It was recently moved 2 to their community branch, so it will be usable in Alpine 3.21.

Footnotes

  1. https://gitlab.alpinelinux.org/alpine/aports/-/issues/15646

  2. https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/70665

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants