forked from continuwuation/continuwuity
Translated the work of @gan (https://codeberg.org/skhron/continuwuity_compilation_lxc) into Dockerfile instructions
46 lines
1.3 KiB
Docker
46 lines
1.3 KiB
Docker
FROM alpine:edge AS builder
|
|
|
|
ARG BUILD_TARGET="aarch64-alpine-linux-musl"
|
|
|
|
RUN apk add --no-cache --update \
|
|
ca-certificates \
|
|
cargo \
|
|
clang20-dev \
|
|
clang20-static \
|
|
curl \
|
|
g++ \
|
|
gcc \
|
|
git \
|
|
libstdc++-dev \
|
|
liburing-dev \
|
|
llvm20-dev \
|
|
llvm20-static \
|
|
make \
|
|
musl-dev \
|
|
ncurses-dev \
|
|
ncurses-static \
|
|
rust \
|
|
rustfmt \
|
|
zlib-static \
|
|
zstd-dev \
|
|
zstd-static
|
|
|
|
ENV CC="gcc"
|
|
ENV CXX="g++"
|
|
ENV PATH="${PATH}:/usr/lib/llvm20/bin"
|
|
ENV LD_LIBRARY_PATH="/usr/lib"
|
|
ENV RUSTFLAGS="-C target-feature=+crt-static -Crelocation-model=static -Clink-arg=-luring -Clink-arg=-lstdc++ -Clink-arg=-lc"
|
|
ENV FEATURES="bindgen-static blurhashing conduwuit_mods console default element_hacks full io_uring jemalloc jemalloc_conf jemalloc_prof jemalloc_stats jemalloc_prof jemalloc_stats media_thumbnail perf_measurements release_max_log_level standard tokio_console url_preview zstd_compression"
|
|
|
|
WORKDIR /app
|
|
COPY . .
|
|
RUN sed -i "s/\"bindgen-runtime\", # replace with bindgen-static on alpine/\"bindgen-static\"/g" ./src/main/Cargo.toml
|
|
RUN cargo build --features="${FEATURES}" --release --target ${BUILD_TARGET}
|
|
RUN mv target/${BUILD_TARGET}/release/conduwuit /tmp/
|
|
|
|
FROM scratch
|
|
|
|
WORKDIR /
|
|
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
|
|
COPY --from=builder /tmp/conduwuit /sbin/conduwuit
|
|
CMD ["/sbin/conduwuit"]
|