Skip to content

Commit f9b204f

Browse files
committed
fix containerd version
Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent b8eb72b commit f9b204f

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

static/Makefile

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ BUILDX_DIR=$(realpath $(CURDIR)/../src/github.com/docker/buildx)
66
COMPOSE_DIR=$(realpath $(CURDIR)/../src/github.com/docker/compose)
77

88
GEN_STATIC_VER=$(shell ./gen-static-ver $(CLI_DIR) $(VERSION))
9+
CONTAINERD_PKG_VER=$(shell ./gen-containerd-ver $(ENGINE_DIR) $(CONTAINERD_VERSION))
10+
911
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
1012
DIR_TO_HASH:=build/linux
1113
DOCKER_CLI_GOLANG_IMG=golang:$(GO_VERSION)
@@ -58,16 +60,7 @@ static-linux: static-cli static-engine static-buildx-plugin static-compose-plugi
5860
for f in containerd ctr containerd-shim-runc-v2 runc; do \
5961
cp -L $(ENGINE_DIR)/bundles/binary-daemon/$$f build/linux/containerd/$$f; \
6062
done
61-
62-
# Select the default version of containerd based on the docker engine source,
63-
# which is needed for naming the produced .tgz file.
64-
# TODO containerd binaries should be built as part of containerd-packaging, not as part of docker/docker-ce-packaging
65-
set -ex; if [ -z "$(CONTAINERD_VERSION)" ]; then \
66-
export containerd_pkg_version="$$(awk -F'=' '$$1 == "ARG CONTAINERD_VERSION" {{sub("v","")}; print $$2 }' "$(ENGINE_DIR)/Dockerfile.windows")"; \
67-
else \
68-
export containerd_pkg_version="$(CONTAINERD_VERSION:v%=%)"; \
69-
fi \
70-
&& tar -C build/linux -c -z -f build/linux/containerd-$${containerd_pkg_version}.tgz containerd
63+
tar -C build/linux -c -z -f build/linux/containerd-$(CONTAINERD_PKG_VER).tgz containerd
7164

7265
# extra binaries for running rootless
7366
mkdir -p build/linux/docker-rootless-extras

static/gen-containerd-ver

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
engine_dir="$1"
4+
# containerd_pkg_version is used to name the containerd-<version>.tgz file.
5+
containerd_pkg_version="$2"
6+
7+
if [ -z "${containerd_pkg_version}" ]; then
8+
# If no custom version is set for containerd, we select the default version of
9+
# containerd based on the docker engine source.
10+
# which is needed for naming the produced .tgz file.
11+
# TODO containerd binaries should be built as part of containerd-packaging, not as part of docker/docker-ce-packaging
12+
awk -F'=' '$1 == "ARG CONTAINERD_VERSION" {{sub("v","")}; print $2 }' "${engine_dir}/Dockerfile.windows"
13+
else
14+
echo "${containerd_pkg_version#v}"
15+
fi

0 commit comments

Comments
 (0)