From fa9bfdf8b1befb6452b1a2905b0a5a1a92f8ee39 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Thu, 10 Feb 2022 21:05:57 -0800 Subject: [PATCH 1/2] 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"] From e56be9f674d5803bad82b2a9552eb11498874625 Mon Sep 17 00:00:00 2001 From: Gavin Mogan Date: Fri, 11 Feb 2022 23:06:04 -0800 Subject: [PATCH 2/2] Dont update dockerfile with latest tag --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9615f43..d852520 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,6 @@ pre-release-replacements = [ {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, {file="CHANGELOG.md", search="", replace="\n## [Unreleased] - ReleaseDate\n", exactly=1}, {file="CHANGELOG.md", search="", replace="\n[Unreleased]: https://github.com/crate-ci/typos/compare/{{tag_name}}...HEAD", exactly=1}, - {file="Dockerfile", search="ARG VERSION=.*", replace="ARG VERSION={{version}}", min=1}, {file="docker/Dockerfile", search="ARG VERSION=.*", replace="ARG VERSION={{version}}", min=1}, {file="docs/pre-commit.md", search="rev: .*", replace="rev: {{tag_name}}", exactly=1}, {file="setup.py", search="TYPOS_VERSION = .*", replace="TYPOS_VERSION = '{{version}}'", exactly=1},