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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
Dockerfile
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:20.04
ARG VERSION=1.4.0
epage marked this conversation as resolved.
Show resolved Hide resolved
ENV VERSION=${VERSION}
RUN apt-get update && apt-get install -y wget
RUN wget https://github.com/crate-ci/typos/releases/download/v${VERSION}/typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz && \
tar -xzvf typos-v${VERSION}-x86_64-unknown-linux-musl.tar.gz && \
mv typos /usr/local/bin
ENTRYPOINT ["/usr/local/bin/typos"]
FROM rust:1.58.1 as builder
WORKDIR /usr/src/typos
COPY . .
RUN cargo install --path .
epage marked this conversation as resolved.
Show resolved Hide resolved

FROM debian:buster-slim
COPY --from=builder /usr/local/cargo/bin/typos /usr/local/bin/typos
epage marked this conversation as resolved.
Show resolved Hide resolved
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/