Skip to content

Commit 9a11954

Browse files
committed
static-linux: verify that binaries are static
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 27c96a3 commit 9a11954

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

static/Makefile

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

77
GEN_STATIC_VER=$(shell ./gen-static-ver $(CLI_DIR) $(VERSION))
88
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
9+
LDD_RUN=ldd >/dev/null 2>/dev/null
910
DIR_TO_HASH:=build/linux
1011
DOCKER_CLI_GOLANG_IMG=golang:$(GO_VERSION)
1112

@@ -43,6 +44,7 @@ static-linux: static-cli static-engine static-buildx-plugin ## create tgz
4344
mkdir -p build/linux/docker
4445
cp $(CLI_DIR)/build/docker build/linux/docker/
4546
for f in dockerd containerd ctr containerd-shim containerd-shim-runc-v2 docker-init docker-proxy runc; do \
47+
if $(LDD_RUN) $(ENGINE_DIR)/bundles/binary-daemon/$$f; then echo "$$f is not static, exiting..."; exit 1; fi; \
4648
cp -L $(ENGINE_DIR)/bundles/binary-daemon/$$f build/linux/docker/$$f; \
4749
done
4850
tar -C build/linux -c -z -f build/linux/docker-$(GEN_STATIC_VER).tgz docker
@@ -51,6 +53,7 @@ static-linux: static-cli static-engine static-buildx-plugin ## create tgz
5153
mkdir -p build/linux/docker-rootless-extras
5254
for f in rootlesskit rootlesskit-docker-proxy dockerd-rootless.sh dockerd-rootless-setuptool.sh vpnkit; do \
5355
if [ -f $(ENGINE_DIR)/bundles/binary-daemon/$$f ]; then \
56+
if $(LDD_RUN) $(ENGINE_DIR)/bundles/binary-daemon/$$f; then echo "$$f is not static, exiting..."; exit 1; fi; \
5457
cp -L $(ENGINE_DIR)/bundles/binary-daemon/$$f build/linux/docker-rootless-extras/$$f; \
5558
fi \
5659
done

0 commit comments

Comments
 (0)