-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathDockerfile.kubectl
More file actions
39 lines (29 loc) · 1.02 KB
/
Copy pathDockerfile.kubectl
File metadata and controls
39 lines (29 loc) · 1.02 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
# Dockerfile for kubectl CLI tool
FROM rust:latest AS builder
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
protobuf-compiler \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY Cargo.toml Cargo.lock* ./
COPY crates/kubectl/Cargo.toml ./crates/kubectl/
COPY crates/common/Cargo.toml ./crates/common/
COPY crates/storage/Cargo.toml ./crates/storage/
COPY crates/api-server/Cargo.toml ./crates/api-server/
COPY crates/scheduler/Cargo.toml ./crates/scheduler/
COPY crates/controller-manager/Cargo.toml ./crates/controller-manager/
COPY crates/kubelet/Cargo.toml ./crates/kubelet/
COPY crates/kube-proxy/Cargo.toml ./crates/kube-proxy/
COPY crates ./crates
ENV CARGO_BUILD_JOBS=2
RUN cargo build --release --bin kubectl
FROM debian:sid-slim
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /app/target/release/kubectl /app/kubectl
ENTRYPOINT ["/app/kubectl"]
CMD ["--server", "http://api-server:6443"]