-
Notifications
You must be signed in to change notification settings - Fork 9
/
Dockerfile
55 lines (37 loc) · 1.19 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
ARG RUST_OS=latest
ARG SBCL_TAG=2.4.4
ARG SBCL_OS=debian
ARG ENDB_OS=debian
ARG ENDB_GIT_DESCRIBE="<unknown revision>"
FROM docker.io/rust:$RUST_OS AS rust-build-env
ARG RUST_OS
ARG ENDB_GIT_DESCRIBE
RUN if [ "$RUST_OS" = "alpine" ]; then \
apk add --no-cache musl-dev; \
fi;
WORKDIR /root/endb
COPY ./lib /root/endb
ENV RUSTFLAGS="-C target-feature=-crt-static"
ENV ENDB_GIT_DESCRIBE=$ENDB_GIT_DESCRIBE
RUN cargo test; cargo build --release
FROM docker.io/fukamachi/sbcl:$SBCL_TAG-$SBCL_OS AS sbcl-build-env
ARG SBCL_OS
RUN if [ "$SBCL_OS" = "alpine" ]; then \
apk add --no-cache gcc musl-dev; \
else \
apt-get update && apt-get install -y --no-install-recommends build-essential; \
fi;
WORKDIR /root/endb
COPY . /root/endb
COPY --from=rust-build-env /root/endb/target/release/libendb.so /root/endb/target/libendb.so
RUN make -e CARGO=echo test slt-test-ci target/endb
FROM docker.io/$ENDB_OS
ARG ENDB_OS
RUN if [ "$ENDB_OS" = "alpine" ]; then \
apk add --no-cache libgcc zstd-dev; \
fi;
WORKDIR /app
COPY --from=rust-build-env /root/endb/target/release/libendb.so /app
COPY --from=sbcl-build-env /root/endb/target/endb /app
EXPOSE 3803
ENTRYPOINT ["./endb"]