forked from linkerd/linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathamd64.dockerfile
23 lines (21 loc) · 947 Bytes
/
amd64.dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
ARG RUST_IMAGE=docker.io/library/rust:1.60.0
ARG RUNTIME_IMAGE=gcr.io/distroless/cc
# Builds the controller binary.
FROM $RUST_IMAGE as build
ARG TARGETARCH
WORKDIR /build
COPY bin/scurl bin/scurl
COPY Cargo.toml Cargo.lock .
COPY policy-controller policy-controller
RUN cargo new policy-test --lib
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.60.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo fetch
RUN --mount=type=cache,target=target \
--mount=type=cache,from=rust:1.60.0,source=/usr/local/cargo,target=/usr/local/cargo \
cargo build --frozen --target=x86_64-unknown-linux-gnu --release --package=linkerd-policy-controller && \
mv target/x86_64-unknown-linux-gnu/release/linkerd-policy-controller /tmp/
# Creates a minimal runtime image with the controller binary.
FROM $RUNTIME_IMAGE
COPY --from=build /tmp/linkerd-policy-controller /bin/
ENTRYPOINT ["/bin/linkerd-policy-controller"]