findpenguins-feed/Containerfile
Sebastian Hugentobler 92f7a489fb
Some checks failed
Build Multiarch Container Image / call-reusable-workflow (push) Has been cancelled
use gitea actions
2023-12-15 07:57:54 +01:00

27 lines
553 B
Docker

FROM docker.io/rust:1-alpine3.18 AS builder
RUN apk --no-cache add musl-dev
ENV CARGO_CARGO_NEW_VCS="none"
ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static"
WORKDIR /work
RUN cargo init
COPY Cargo.toml Cargo.lock ./
RUN cargo build --release --target=$(arch)-unknown-linux-musl
COPY . .
# ensure rebuilding of the app
RUN touch src/main.rs
RUN cargo build --release --target=$(arch)-unknown-linux-musl
RUN cp "./target/$(arch)-unknown-linux-musl/release/findpenguins-feed" /app
FROM scratch
COPY --from=builder /app /app
CMD ["/app"]