Switch to debian:trixie-slim image

This commit is contained in:
2026-05-23 23:16:05 -07:00
parent 424f83ed94
commit 574d3111bc

View File

@@ -1,44 +1,39 @@
# build # build
FROM alpine:3 as build FROM debian:trixie-slim as build
WORKDIR /usr/src/app WORKDIR /usr/src/app
RUN apk update && apk upgrade && apk add \ RUN apt update && apt upgrade -y && apt install -y \
linux-headers \ git \
git \ clang \
clang18 \ build-essential \
make \ libsqlite3-dev
sqlite-dev
COPY src ./src
COPY src ./src COPY vendor ./vendor
COPY vendor ./vendor COPY .git ./.git
COPY .git ./.git COPY Makefile CMakeLists.txt version.h.in ./
COPY Makefile CMakeLists.txt version.h.in ./
RUN make nosandbox -j$(nproc)
RUN sed -i 's/^CC=clang$/&-18/' Makefile
RUN sed -i 's/^CXX=clang++$/&-18/' Makefile # export-only stage: `docker build --target=export --output=./bin .`
FROM scratch AS export
RUN make nosandbox -j$(nproc) COPY --from=build /usr/src/app/bin/fusion /fusion
# export-only stage: `docker build --target=export --output=./bin .` # prod
FROM scratch AS export FROM debian:trixie-slim
COPY --from=build /usr/src/app/bin/fusion /fusion
WORKDIR /usr/src/app
# prod
FROM alpine:3 RUN apt update && apt upgrade -y && apt install -y \
libsqlite3-dev
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/bin/fusion /bin/fusion
RUN apk update && apk upgrade && apk add \
libstdc++ \ CMD ["/bin/fusion"]
sqlite-dev
EXPOSE 23000/tcp
COPY --from=build /usr/src/app/bin/fusion /bin/fusion EXPOSE 23001/tcp
EXPOSE 8003/tcp
CMD ["/bin/fusion"]
LABEL Name=openfusion Version=2.0.0
EXPOSE 23000/tcp
EXPOSE 23001/tcp
EXPOSE 8003/tcp
LABEL Name=openfusion Version=2.0.0