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:
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -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
|
||||||
14
Dockerfile
14
Dockerfile
@@ -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"]
|
||||||
Reference in New Issue
Block a user