Go-based network automation with YANG models, gRPC, Ansible, Terraform, and Kubernetes integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
33 lines
940 B
Text
33 lines
940 B
Text
FROM docker.io/library/golang:1.23-bookworm AS builder
|
|
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -o /bin/kedge-cni ./cmd/kedge-cni
|
|
RUN CGO_ENABLED=0 go build -o /bin/kedge-daemon ./cmd/kedge-daemon
|
|
|
|
# --- CNI plugin image (installed into host /opt/cni/bin/) ---
|
|
FROM scratch AS cni
|
|
COPY --from=builder /bin/kedge-cni /kedge-cni
|
|
|
|
# --- DaemonSet image ---
|
|
FROM docker.io/library/debian:bookworm-slim AS daemon
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
wireguard-tools \
|
|
iproute2 \
|
|
iptables \
|
|
python3 \
|
|
python3-pip \
|
|
python3-venv \
|
|
ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=builder /bin/kedge-daemon /usr/local/bin/kedge-daemon
|
|
COPY yang/ /opt/kedge/yang/
|
|
|
|
RUN python3 -m venv /opt/kedge/venv \
|
|
&& /opt/kedge/venv/bin/pip install --no-cache-dir -r /opt/kedge/yang/requirements.txt
|
|
|
|
ENTRYPOINT ["kedge-daemon"]
|