initial commit
This commit is contained in:
commit
2a9f427bc7
21 changed files with 3692 additions and 0 deletions
29
Containerfile
Normal file
29
Containerfile
Normal file
|
@ -0,0 +1,29 @@
|
|||
FROM docker.io/rust:1-alpine3.18 AS builder
|
||||
|
||||
ARG ARCH=x86_64
|
||||
|
||||
RUN apk --no-cache add musl-dev
|
||||
|
||||
ENV CARGO_CARGO_NEW_VCS="none"
|
||||
ENV CARGO_BUILD_RUSTFLAGS="-C target-feature=+crt-static"
|
||||
ENV CARGO_BUILD_TARGET="$ARCH-unknown-linux-musl"
|
||||
|
||||
WORKDIR /work
|
||||
|
||||
RUN cargo init
|
||||
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN cargo build --release
|
||||
|
||||
COPY . .
|
||||
|
||||
# ensure rebuilding of the app
|
||||
RUN touch src/main.rs
|
||||
RUN cargo build --release
|
||||
RUN cp "./target/$CARGO_BUILD_TARGET/release/findpenguins-feed" /app
|
||||
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=builder /app /app
|
||||
CMD ["/app"]
|
Loading…
Add table
Add a link
Reference in a new issue