Skip to content

Commit

Permalink
static-linux: verify that binaries are static
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Mar 24, 2021
1 parent 48959a1 commit fa04674
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions static/Makefile
Expand Up @@ -4,6 +4,7 @@ CLI_DIR=$(realpath $(CURDIR)/../src/github.com/docker/cli)
ENGINE_DIR=$(realpath $(CURDIR)/../src/github.com/docker/docker)
GEN_STATIC_VER=$(shell ./gen-static-ver $(CLI_DIR) $(VERSION))
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
LDD_RUN=ldd >/dev/null 2>/dev/null
DIR_TO_HASH:=build/linux
GO_VERSION=$(shell grep "ARG GO_VERSION" $(CLI_DIR)/dockerfiles/Dockerfile.dev | awk -F'=' '{print $$2}')
DOCKER_CLI_GOLANG_IMG=golang:$(GO_VERSION)
Expand All @@ -26,6 +27,7 @@ static-linux: static-cli static-engine ## create tgz with linux x86_64 client an
mkdir -p build/linux/docker
cp $(CLI_DIR)/build/docker build/linux/docker/
for f in dockerd containerd ctr containerd-shim containerd-shim-runc-v2 docker-init docker-proxy runc; do \
if $(LDD_RUN) $(ENGINE_DIR)/bundles/binary-daemon/$$f; then echo "$$f is not static, exiting..."; exit 1; fi; \
cp -L $(ENGINE_DIR)/bundles/binary-daemon/$$f build/linux/docker/$$f; \
done
tar -C build/linux -c -z -f build/linux/docker-$(GEN_STATIC_VER).tgz docker
Expand All @@ -34,6 +36,7 @@ static-linux: static-cli static-engine ## create tgz with linux x86_64 client an
mkdir -p build/linux/docker-rootless-extras
for f in rootlesskit rootlesskit-docker-proxy dockerd-rootless.sh dockerd-rootless-setuptool.sh vpnkit; do \
if [ -f $(ENGINE_DIR)/bundles/binary-daemon/$$f ]; then \
if $(LDD_RUN) $(ENGINE_DIR)/bundles/binary-daemon/$$f; then echo "$$f is not static, exiting..."; exit 1; fi; \
cp -L $(ENGINE_DIR)/bundles/binary-daemon/$$f build/linux/docker-rootless-extras/$$f; \
fi \
done
Expand Down

0 comments on commit fa04674

Please sign in to comment.