diff --git a/.woodpecker/publish-rust-ci-image.yml b/.woodpecker/publish-rust-ci-image.yml new file mode 100644 index 0000000..4fa1b14 --- /dev/null +++ b/.woodpecker/publish-rust-ci-image.yml @@ -0,0 +1,16 @@ +when: + event: [push, manual] + branch: main + path: ["rust.Dockerfile"] + +steps: + publish: + image: plugins/kaniko + settings: + repo: jasterv/rust-ci + tags: latest + username: + from_secret: DOCKERHUB_USERNAME + password: + from_secret: DOCKERHUB_PASSWORD + dockerfile: rust.Dockerfile diff --git a/README.md b/README.md index 83d1ebe..0587294 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # docker -My docker images \ No newline at end of file +In this repo I define my public docker images for my own use. + +## Public images + ++ `jasterv/rust-ci`: Based on the official `rust` image but contains additional tools that I use on all my projects: `cargo clippy`, `cargo nextest`, `cargo deny`, `cargo make` diff --git a/rust.Dockerfile b/rust.Dockerfile new file mode 100644 index 0000000..9216adb --- /dev/null +++ b/rust.Dockerfile @@ -0,0 +1,19 @@ +FROM rust:1.93.1-slim-bookworm + +# Install system dependencies for cargo-binstall and common rust crates +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + ca-certificates \ + pkg-config \ + libssl-dev \ + && rm -rf /var/lib/apt/lists/* + +# Pre-install rustup components +RUN rustup component add clippy rustfmt + +# Install cargo-binstall and your tools +RUN curl -Lskj https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | tar -xz -C /usr/local/bin +RUN cargo binstall --no-confirm cargo-make cargo-deny cargo-nextest + +# Set environment variables so they don't need to be in .woodpecker.yml +ENV CARGO_TERM_COLOR=always