This commit is contained in:
Peter Zam 2024-08-13 16:17:29 +02:00 committed by GitHub
commit ecf8f7cb90
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,29 +1,19 @@
FROM rust:slim as BUILD
FROM rust:alpine as BUILD
WORKDIR /app/
RUN apk add --no-cache nasm git g++
COPY . .
RUN git clone https://github.com/TeamPiped/piped-proxy.git /app
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && \
apt-get install -y --no-install-recommends \
nasm && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target/ \
cargo build --release && \
mv target/release/piped-proxy .
FROM debian:stable-slim
FROM scratch
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && \
apt-get install -y --no-install-recommends \
ca-certificates && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app/
WORKDIR /app
COPY --from=BUILD /app/piped-proxy .