Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [master] add PKG_REVISION to static builds #824

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ PLATFORM=Docker Engine - Community
SHELL:=/bin/bash
VERSION?=0.0.1-dev

# PKG_REVISION is used for packaging-only releases. This variable is used
# when constructing the deb, rpm, and static versions.
PKG_REVISION ?= 1

# DOCKER_CLI_REPO and DOCKER_ENGINE_REPO define the source repositories to clone
# the source from. These can be overridden to build from a fork.
DOCKER_CLI_REPO ?= https://github.com/docker/cli.git
Expand Down Expand Up @@ -53,4 +57,5 @@ VERIFY_PLATFORM ?=
export BUILDTIME
export DEFAULT_PRODUCT_LICENSE
export PACKAGER_NAME
export PKG_REVISION
export PLATFORM
12 changes: 6 additions & 6 deletions static/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static-linux: static-cli static-engine static-buildx-plugin ## create tgz
for f in dockerd containerd ctr containerd-shim containerd-shim-runc-v2 docker-init docker-proxy runc; do \
cp -L $(ENGINE_DIR)/bundles/binary/$$f build/linux/docker/$$f; \
done
tar -C build/linux -c -z -f build/linux/docker-$(GEN_STATIC_VER).tgz docker
tar -C build/linux -c -z -f build/linux/docker-$(GEN_STATIC_VER)-$(PKG_REVISION).tgz docker

# extra binaries for running rootless
mkdir -p build/linux/docker-rootless-extras
Expand All @@ -55,10 +55,10 @@ static-linux: static-cli static-engine static-buildx-plugin ## create tgz
cp -L $(ENGINE_DIR)/bundles/binary/$$f build/linux/docker-rootless-extras/$$f; \
fi \
done
tar -C build/linux -c -z -f build/linux/docker-rootless-extras-$(GEN_STATIC_VER).tgz docker-rootless-extras
tar -C build/linux -c -z -f build/linux/docker-rootless-extras-$(GEN_STATIC_VER)-$(PKG_REVISION).tgz docker-rootless-extras

# buildx
tar -C $(BUILDX_DIR)/bin -c -z -f build/linux/docker-buildx-plugin-$(DOCKER_BUILDX_REF:v%=%).tgz docker-buildx
tar -C $(BUILDX_DIR)/bin -c -z -f build/linux/docker-buildx-plugin-$(DOCKER_BUILDX_REF:v%=%)-$(PKG_REVISION).tgz docker-buildx

.PHONY: hash_files
hash_files:
Expand All @@ -76,7 +76,7 @@ cross-mac: buildx
arch=$$(echo $$platform | cut -d_ -f2); \
mkdir -p $$dest/$$arch/docker; \
cp $$platform/docker-darwin-* $$dest/$$arch/docker/docker && \
tar -C $$dest/$$arch -c -z -f $$dest/$$arch/docker-$(GEN_STATIC_VER).tgz docker; \
tar -C $$dest/$$arch -c -z -f $$dest/$$arch/docker-$(GEN_STATIC_VER)-$(PKG_REVISION).tgz docker; \
done

.PHONY: cross-win
Expand All @@ -86,14 +86,14 @@ cross-win: cross-win-engine
cp $(CLI_DIR)/build/docker-windows-amd64.exe build/win/amd64/docker/docker.exe
cp $(ENGINE_DIR)/bundles/cross/win/dockerd.exe build/win/amd64/docker/dockerd.exe
cp $(ENGINE_DIR)/bundles/cross/win/docker-proxy.exe build/win/amd64/docker/docker-proxy.exe
docker run --rm -v $(CURDIR)/build/win/amd64:/v -w /v alpine sh -c 'apk update&&apk add zip&&zip -r docker-$(GEN_STATIC_VER).zip docker'
docker run --rm -v $(CURDIR)/build/win/amd64:/v -w /v alpine sh -c 'apk update&&apk add zip&&zip -r docker-$(GEN_STATIC_VER)-$(PKG_REVISION).zip docker'
$(CHOWN) -R $(shell id -u):$(shell id -g) build

.PHONY: cross-arm
cross-arm: cross-all-cli ## create tgz with linux armhf client only
mkdir -p build/arm/docker
cp $(CLI_DIR)/build/docker-linux-arm build/arm/docker/docker
tar -C build/arm -c -z -f build/arm/docker-$(GEN_STATIC_VER).tgz docker
tar -C build/arm -c -z -f build/arm/docker-$(GEN_STATIC_VER)-$(PKG_REVISION).tgz docker

.PHONY: static-cli
static-cli:
Expand Down