Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change image to scratch & builder image to alpine #193

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Copy link
Member

@Bnyro Bnyro Aug 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's unnecessary, you should just leave that as it was before and copy the source code from the current directory instead of cloning it.


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 .

Expand Down