Skip to content

Commit

Permalink
Build containerd using runc v1.1.12
Browse files Browse the repository at this point in the history
Fixes CVE-2024-21626 for the bundled containerd binaries.

K0s cannot use any containerd release past v1.7.8 due to dependency
conflicts. Hence ensure that the binary is built linking against a
non-vulnerable version of runc at least.

Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed Feb 1, 2024
1 parent 8d44637 commit eb90ee9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions embedded-bins/containerd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,17 @@ ARG TARGET_OS \
CONTAINERD_BINS

RUN go version
RUN make \
CGO_ENABLED=${BUILD_GO_CGO_ENABLED} \
SHIM_CGO_ENABLED=${BUILD_SHIM_GO_CGO_ENABLED} \
GO_TAGS="-tags=${BUILD_GO_TAGS}" \
COMMANDS="${CONTAINERD_BINS}" \
GO_BUILD_FLAGS="${BUILD_GO_FLAGS}" \
EXTRA_LDFLAGS="${BUILD_GO_LDFLAGS_EXTRA}" \
GOOS="${TARGET_OS}"
RUN set -ex \
&& go get github.com/opencontainers/[email protected] \
&& make \
CGO_ENABLED=${BUILD_GO_CGO_ENABLED} \
SHIM_CGO_ENABLED=${BUILD_SHIM_GO_CGO_ENABLED} \
GO_TAGS="-tags=${BUILD_GO_TAGS}" \
COMMANDS="${CONTAINERD_BINS}" \
GO_BUILD_FLAGS="${BUILD_GO_FLAGS}" \
EXTRA_LDFLAGS="${BUILD_GO_LDFLAGS_EXTRA}" \
GOOS="${TARGET_OS}" \
vendor all

FROM scratch
COPY --from=build /go/src/github.com/containerd/containerd/bin/* /bin/

0 comments on commit eb90ee9

Please sign in to comment.