-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (25 loc) · 998 Bytes
/
Dockerfile
File metadata and controls
30 lines (25 loc) · 998 Bytes
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
# Dockerfile
ARG TARGET=x86_64-unknown-linux-musl
FROM clux/muslrust:stable AS build
ARG TARGET
# Add certificate and uncomment if building behind proxy with custom cert
# COPY ./gitignore/ca-certificates.crt /usr/local/share/ca-certificates/ca.crt
# RUN update-ca-certificates
COPY . /project
WORKDIR /project
# Install the target if not x86_64 (default)
RUN if [ "$TARGET" != "x86_64-unknown-linux-musl" ]; then \
rustup target add $TARGET; \
fi
# Ignore cache mounts for now, but might be useful at some point
# RUN --mount=type=cache,id=cargo-git,target=/home/rust/.cargo/git \
# --mount=type=cache,id=cargo-registry,target=/home/rust/.cargo/registry \
# --mount=type=cache,id=rust-target,target=/home/rust/src/target \
# cargo build -p leaf-server --release --target $TARGET
RUN cargo build -p leaf-server --release --target $TARGET
FROM alpine:3
ARG TARGET
COPY --from=build /project/target/${TARGET}/release/leaf /leaf
CMD ["server"]
ENTRYPOINT ["/leaf"]
EXPOSE 5530