From fa9bfdf8b1befb6452b1a2905b0a5a1a92f8ee39 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Thu, 10 Feb 2022 21:05:57 -0800 Subject: [PATCH] New dockerfile for #427. Builds on demand --- .dockerignore | 2 ++ Dockerfile | 16 ++++++++-------- 2 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ac1b94d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +/target +Dockerfile diff --git a/Dockerfile b/Dockerfile index e48341f..ec1edb6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ -FROM ubuntu:20.04 -ARG VERSION=1.4.0 -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 . + +FROM debian:buster-slim +COPY --from=builder /usr/local/cargo/bin/typos /usr/local/bin/typos +CMD ["typos"]