diff --git a/.drone.yml b/.drone.yml index f6e4aa2..3470ae6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,6 +7,16 @@ platform: arch: amd64 steps: + - name: build + image: clux/muslrust:1.89.0-stable + commands: + - cargo build --release --target x86_64-unknown-linux-musl + when: + branch: + - master + event: + - pull_request + - name: image image: plugins/docker settings: @@ -19,6 +29,15 @@ steps: password: from_secret: GIT_PASS dockerfile: Containerfile + depends_on: + - build when: branch: - - master \ No newline at end of file + - master + event: + - push +--- +kind: signature +hmac: 2ea2c509e3a97dde06bbb7e5ee8337af2cae5b91b4153d6f8666da832b99bb8f + +... diff --git a/Containerfile b/Containerfile index aa1cb3e..d0253bc 100644 --- a/Containerfile +++ b/Containerfile @@ -1,23 +1,3 @@ -# Using the `rust-musl-builder` as base image, instead of -# the official Rust toolchain -FROM docker.io/clux/muslrust:stable AS chef -USER root -RUN cargo install cargo-chef -WORKDIR /app - -FROM chef AS planner -COPY . . -RUN cargo chef prepare --recipe-path recipe.json - -FROM chef AS builder -COPY --from=planner /app/recipe.json recipe.json -# Notice that we are specifying the --target flag! -RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json -COPY . . -RUN cargo build --release --target x86_64-unknown-linux-musl --bin asset-tool - -FROM docker.io/alpine:latest AS runtime -RUN addgroup -S myuser && adduser -S myuser -G myuser -COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/asset-tool /usr/local/bin/ -USER myuser -ENTRYPOINT ["/usr/local/bin/asset-tool"] \ No newline at end of file +FROM alpine:3.22 AS runtime +COPY /target/x86_64-unknown-linux-musl/release/asset-tool / +ENTRYPOINT ["/asset-tool"]