m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-12 07:03:48 -05:00

Optimize docker build workflow

This commit is contained in:
Sergio
2024-07-09 15:08:58 +03:00
parent 3585851d08
commit 5131c5e570
2 changed files with 10 additions and 8 deletions

View File

@@ -33,4 +33,6 @@ jobs:
context: . context: .
push: true push: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
tags: ghcr.io/sergi0g/cup:latest tags: ghcr.io/sergi0g/cup:latest
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@@ -1,15 +1,15 @@
FROM rust:alpine AS build FROM rust:alpine AS build
WORKDIR /cup
RUN apk add musl-dev RUN apk add musl-dev
COPY src src RUN cargo new cup
COPY Cargo.toml . WORKDIR /cup
COPY Cargo.lock . COPY Cargo.toml Cargo.lock .
RUN cargo build --release RUN cargo build --release
COPY src ./src
RUN cargo install --path .
FROM scratch FROM scratch
COPY --from=build /cup/target/release/cup /cup COPY --from=build /usr/local/cargo/bin/cup /cup
ENTRYPOINT ["/cup"] ENTRYPOINT ["/cup"]