This repository was archived by the owner on Sep 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Expand file tree
/
Copy pathContainerfile.controlplane
More file actions
62 lines (46 loc) · 1.5 KB
/
Containerfile.controlplane
File metadata and controls
62 lines (46 loc) · 1.5 KB
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
56
57
58
59
60
61
62
# ------------------------------------------------------------------------------
# Builder
# ------------------------------------------------------------------------------
FROM debian:trixie-slim AS builder
RUN apt update \
&& apt install -y build-essential rustup
ARG UID
ARG GID
ARG WORK_DIR
RUN chown "${UID}:${GID}" ${WORK_DIR}
USER ${UID}:${GID}
ENV RUSTUP_HOME=${WORK_DIR}/target
# allow re-using of cargo downloads trough saving in target/
ENV CARGO_HOME=${WORK_DIR}/target
RUN rustup install stable \
&& rustup default stable
ARG BUILD_TIMESTAMP
WORKDIR ${WORK_DIR}
# /workspace needs to be volume mounted
# ${WORK_DIR}/target can be optionally volume mounted
RUN echo "${BUILD_TIMESTAMP}" \
&& date +%s \
&& cp -a /workspace/Cargo.toml \
/workspace/Cargo.lock \
/workspace/.cargo/ \
/workspace/controlplane/ \
/workspace/dataplane/ \
/workspace/tests-integration/ \
/workspace/tools/ \
/workspace/xtask/ \
${WORK_DIR}
RUN date +%s \
&& cargo build --package controlplane \
&& date +%s \
&& mkdir -p results/ \
&& cp target/debug/controller results/
# ------------------------------------------------------------------------------
# Image
# ------------------------------------------------------------------------------
FROM debian:trixie-slim
LABEL org.opencontainers.image.source=https://github.com/kubernetes-sigs/blixt
WORKDIR /
USER 1000:1000
ARG WORK_DIR
COPY --from=builder ${WORK_DIR}/results/controller /controller
ENTRYPOINT [ "/controller" ]