-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 823 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 823 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
FROM rust:1-bookworm AS builder
WORKDIR /usr/src/myapp
COPY . .
ARG CARGO_PARAMS
ARG GIT_COMMIT
ARG GIT_BRANCH
ARG IMAGE_NAME
RUN apt-get update && apt-get install -y protobuf-compiler
RUN echo "Running cargo build with params: $CARGO_PARAMS" && cargo build --release $CARGO_PARAMS
FROM debian:bookworm-slim
ARG CARGO_PARAMS
ARG GIT_COMMIT
ARG GIT_BRANCH
COPY --from=builder /usr/src/myapp/target/release/horust /sbin/horust
RUN mkdir -p /etc/horust/services/ && apt-get update && apt-get install bash
ENV HORUST_LOG=info
ENV GIT_COMMIT=$GIT_COMMIT
ENV GIT_BRANCH=$GIT_BRANCH
ENV CARGO_PARAMS=$CARGO_PARAMS
ENTRYPOINT ["/sbin/horust"]
RUN echo "{\"rev\":\"$GIT_COMMIT\",\"branch\":\"${GIT_BRANCH}\",\"cargo-params\":\"${CARGO_PARAMS}\" }" > /etc/horust/buildinfo.json
CMD ["--services-path", "/etc/horust/services/"]