Skip to content

Commit 4e01307

Browse files
authored
feat(cni-installer): integrate cni installer (#784)
Build cni installer into the runtime docker image. Drop tooling from the runtime docker image required to enable the installer shell script. Remove the shell script and jq filter file from the repo. Tested by running through the plugin integration tests locally. Signed-off by: Raymond Kroeker raymond@buoyant.io
1 parent 5cf5354 commit 4e01307

3 files changed

Lines changed: 7 additions & 415 deletions

File tree

Dockerfile-cni-plugin

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44
FROM --platform=$BUILDPLATFORM golang:1.26.4-alpine as go
55
WORKDIR /build
66
COPY --link go.mod go.sum ./
7+
COPY --link ./cni-install ./cni-install
78
COPY --link ./cni-plugin ./cni-plugin
9+
COPY --link ./internal ./internal
810
COPY --link ./proxy-init ./proxy-init
911
COPY --link ./pkg ./pkg
1012
RUN go mod download
1113
ARG TARGETARCH
1214
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=on \
1315
go build -o /go/bin/linkerd-cni -mod=readonly -ldflags "-s -w" -v ./cni-plugin/
16+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH GO111MODULE=on \
17+
go build -o /go/bin/linkerd2-cni-install -mod=readonly -ldflags "-s -w" -v ./cni-install/
18+
1419

1520
FROM --platform=$BUILDPLATFORM ghcr.io/linkerd/dev:v50-rust-musl as cni-repair-controller
1621
WORKDIR /build
@@ -41,18 +46,8 @@ RUN --mount=type=cache,target=target \
4146

4247
FROM --platform=$TARGETPLATFORM alpine:3.24.1 as runtime
4348
WORKDIR /linkerd
44-
RUN apk add \
45-
# For inotifywait
46-
inotify-tools \
47-
# For pgrep
48-
procps \
49-
bash \
50-
jq
51-
5249
COPY --from=go /go/bin/linkerd-cni /opt/cni/bin/
50+
COPY --from=go /go/bin/linkerd2-cni-install /usr/bin/
5351
COPY --from=cni-repair-controller /build/linkerd-cni-repair-controller /usr/lib/linkerd/
5452
COPY LICENSE .
55-
COPY cni-plugin/deployment/scripts/install-cni.sh .
56-
COPY cni-plugin/deployment/scripts/filter.jq .
57-
ENV PATH=/linkerd:/opt/cni/bin:$PATH
58-
CMD ["install-cni.sh"]
53+
CMD ["/usr/bin/linkerd2-cni-install"]

cni-plugin/deployment/scripts/filter.jq

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)