Merge pull request #431 from halkeye/dockerfile

New dockerfile for #427.
This commit is contained in:
Ed Page 2022-02-14 08:56:58 -06:00 committed by GitHub
commit d6d69db005
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 9 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
/target
Dockerfile

View file

@ -40,7 +40,6 @@ pre-release-replacements = [
{file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1}, {file="CHANGELOG.md", search="ReleaseDate", replace="{{date}}", min=1},
{file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1}, {file="CHANGELOG.md", search="<!-- next-header -->", replace="<!-- next-header -->\n## [Unreleased] - ReleaseDate\n", exactly=1},
{file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\n[Unreleased]: https://github.com/crate-ci/typos/compare/{{tag_name}}...HEAD", exactly=1}, {file="CHANGELOG.md", search="<!-- next-url -->", replace="<!-- next-url -->\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="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="docs/pre-commit.md", search="rev: .*", replace="rev: {{tag_name}}", exactly=1},
{file="setup.py", search="TYPOS_VERSION = .*", replace="TYPOS_VERSION = '{{version}}'", exactly=1}, {file="setup.py", search="TYPOS_VERSION = .*", replace="TYPOS_VERSION = '{{version}}'", exactly=1},

View file

@ -1,8 +1,8 @@
FROM ubuntu:20.04 FROM rust:1.58.1 as builder
ARG VERSION=1.4.0 WORKDIR /usr/src/typos
ENV VERSION=${VERSION} COPY . .
RUN apt-get update && apt-get install -y wget RUN cargo install --path .
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 && \ FROM debian:buster-slim
mv typos /usr/local/bin COPY --from=builder /usr/local/cargo/bin/typos /usr/local/bin/typos
ENTRYPOINT ["/usr/local/bin/typos"] CMD ["typos"]