Something went wrong. Try again.
Monorepo for Tangled tangled.org
Something went wrong. Try again.
1.6 kB · 41 lines
123456789101112131415161718192021222324252627282930313233343536373839404142FROM rust:1.96-slim-trixie AS builderRUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates pkg-config perl make cmake clang mold \ && rm -rf /var/lib/apt/lists/*ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold"RUN rustup toolchain install 1.96.0 \ --profile minimal \ --component rustfmt \ --component clippy \ --target wasm32-unknown-unknown \ --no-self-updateENV CC=clangENV CXX=clang++ARG BOBBIN_PROFILE=releaseWORKDIR /srcCOPY Cargo.toml Cargo.lock rust-toolchain.toml ./COPY lexicons ./lexiconsCOPY crates ./cratesCOPY bobbin ./bobbin# keep image lighter by not copying in shuttle, gitmirror, knot2# does however need some cargo toml patchingsRUN sed -i \ -e 's/, "shuttle"//' \ -e 's/, "gitmirror\/crates\/\*"//' \ -e 's/, "knot2\/crates\/\*"//' \ -e '/^knot-[a-z0-9-]* = { path = "knot2\/crates\//d' \ -e '/^gitmirror-[a-z0-9-]* = { path = "gitmirror\/crates\//d' \ -e '/^gix-pack = { path = "knot2\/third_party\/gix-pack" }/d' \ Cargo.tomlRUN cargo build --profile ${BOBBIN_PROFILE} --bin bobbin --package bobbinRUN if [ "${BOBBIN_PROFILE}" = "release" ]; then strip target/${BOBBIN_PROFILE}/bobbin; fiFROM debian:trixie-slimARG BOBBIN_PROFILE=releaseRUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ && rm -rf /var/lib/apt/lists/*COPY --from=builder /src/target/${BOBBIN_PROFILE}/bobbin /usr/local/bin/bobbinENV BOBBIN_BIND=0.0.0.0:8090EXPOSE 8090ENTRYPOINT ["/usr/local/bin/bobbin"]