This repository has no description
1.4 kB
38 lines
1FROM rust:1.96-slim-trixie AS builder
2RUN apt-get update && apt-get install -y --no-install-recommends \
3 ca-certificates pkg-config perl make cmake clang mold \
4 && rm -rf /var/lib/apt/lists/*
5ENV RUSTFLAGS="-C linker=clang -C link-arg=-fuse-ld=mold"
6RUN rustup toolchain install 1.96.0 \
7 --profile minimal \
8 --component rustfmt \
9 --component clippy \
10 --target wasm32-unknown-unknown \
11 --no-self-update
12ENV CC=clang
13ENV CXX=clang++
14ARG BOBBIN_PROFILE=release
15WORKDIR /src
16COPY Cargo.toml Cargo.lock rust-toolchain.toml ./
17COPY lexicons ./lexicons
18COPY bobbin ./bobbin
19# keep image lighter by not copying in shittle, knot2
20# does however need some cargo toml patchings
21RUN sed -i \
22 -e 's/, "shuttle"//' \
23 -e 's/, "knot2\/crates\/\*"//' \
24 -e '/^knot-[a-z0-9-]* = { path = "knot2\/crates\//d' \
25 -e '/^gix-pack = { path = "knot2\/third_party\/gix-pack" }/d' \
26 Cargo.toml
27RUN cargo build --profile ${BOBBIN_PROFILE} --bin bobbin --package bobbin
28RUN if [ "${BOBBIN_PROFILE}" = "release" ]; then strip target/${BOBBIN_PROFILE}/bobbin; fi
29
30FROM debian:trixie-slim
31ARG BOBBIN_PROFILE=release
32RUN apt-get update && apt-get install -y --no-install-recommends \
33 ca-certificates \
34 && rm -rf /var/lib/apt/lists/*
35COPY --from=builder /src/target/${BOBBIN_PROFILE}/bobbin /usr/local/bin/bobbin
36ENV BOBBIN_BIND=0.0.0.0:8090
37EXPOSE 8090
38ENTRYPOINT ["/usr/local/bin/bobbin"]