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

New dockerfile for #427. #431

Merged
merged 2 commits into from
Feb 14, 2022
Merged

New dockerfile for #427. #431

merged 2 commits into from
Feb 14, 2022

Conversation

halkeye
Copy link
Contributor

@halkeye halkeye commented Feb 11, 2022

Builds all the binaries on demand, then creates a new image with just the binary.
Easy to do tagged releases or multi arch builds, etc.


FROM debian:buster-slim
COPY --from=builder /usr/local/cargo/bin/typos /usr/local/bin/typos
CMD ["typos"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

having it as command instead of entry point makes it more overriable, but less obvious

docker run crate-ci/typos would run typos
docker run crate-ci/typos bash would run bash
docker run crate-ci/typos typos --with --args would run typos

i can make a smarter entrypoint that handles bash vs not bash though.

https://devopscube.com/run-scripts-docker-arguments/

@halkeye
Copy link
Contributor Author

halkeye commented Feb 11, 2022

Does cargo install build the right one? I'll have to run again when I'm at a computer to confirm its the release version. Otherwise I can probably build release and copy from target instead

Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@epage
Copy link
Collaborator

epage commented Feb 11, 2022

Does cargo install build the right one? I'll have to run again when I'm at a computer to confirm its the release version. Otherwise I can probably build release and copy from target instead

It looks like cargo install does a release build because it has a --debug flag rather than a --release flag.

@halkeye
Copy link
Contributor Author

halkeye commented Feb 12, 2022

@epage
Copy link
Collaborator

epage commented Feb 14, 2022

Thanks!

@epage epage merged commit d6d69db into crate-ci:master Feb 14, 2022
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