chore: switch to distroless Docker runtime images
fix: match Debian releases for build closes #297 Co-authored-by: MaticPoh <85814976+MaticPoh@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM --platform="${BUILDPLATFORM}" rust:1.76.0-slim
|
FROM --platform="${BUILDPLATFORM}" rust:1.80.1-slim-bookworm
|
||||||
USER 0:0
|
USER 0:0
|
||||||
WORKDIR /home/rust/src
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Build Stage
|
# Build Stage
|
||||||
FROM rust:1.76.0-slim
|
FROM rust:1.80.1-slim-bookworm
|
||||||
USER 0:0
|
USER 0:0
|
||||||
WORKDIR /home/rust/src
|
WORKDIR /home/rust/src
|
||||||
|
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/revoltchat/base:latest AS builder
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
FROM debian:bullseye-slim
|
FROM gcr.io/distroless/cc-debian12:nonroot
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y ca-certificates && \
|
|
||||||
apt-get clean
|
|
||||||
COPY --from=builder /home/rust/src/target/release/revolt-bonfire ./
|
COPY --from=builder /home/rust/src/target/release/revolt-bonfire ./
|
||||||
|
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
USER nonroot
|
||||||
CMD ["./revolt-bonfire"]
|
CMD ["./revolt-bonfire"]
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ static CONFIG_BUILDER: Lazy<RwLock<Config>> = Lazy::new(|| {
|
|||||||
));
|
));
|
||||||
} else if std::path::Path::new("Revolt.toml").exists() {
|
} else if std::path::Path::new("Revolt.toml").exists() {
|
||||||
builder = builder.add_source(File::new("Revolt.toml", FileFormat::Toml));
|
builder = builder.add_source(File::new("Revolt.toml", FileFormat::Toml));
|
||||||
|
} else if std::path::Path::new("/Revolt.toml").exists() {
|
||||||
|
builder = builder.add_source(File::new("/Revolt.toml", FileFormat::Toml));
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.build().unwrap()
|
builder.build().unwrap()
|
||||||
|
|||||||
@@ -2,13 +2,11 @@
|
|||||||
FROM ghcr.io/revoltchat/base:latest AS builder
|
FROM ghcr.io/revoltchat/base:latest AS builder
|
||||||
|
|
||||||
# Bundle Stage
|
# Bundle Stage
|
||||||
FROM debian:bullseye-slim
|
FROM gcr.io/distroless/cc-debian12:nonroot
|
||||||
RUN apt-get update && \
|
|
||||||
apt-get install -y ca-certificates && \
|
|
||||||
apt-get clean
|
|
||||||
COPY --from=builder /home/rust/src/target/release/revolt-delta ./
|
COPY --from=builder /home/rust/src/target/release/revolt-delta ./
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
ENV ROCKET_ADDRESS 0.0.0.0
|
ENV ROCKET_ADDRESS 0.0.0.0
|
||||||
ENV ROCKET_PORT 8000
|
ENV ROCKET_PORT 8000
|
||||||
|
USER nonroot
|
||||||
CMD ["./revolt-delta"]
|
CMD ["./revolt-delta"]
|
||||||
|
|||||||
Reference in New Issue
Block a user