From b3cf6953577a1f187cf6ff866fa2f308e80cdfc1 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Mon, 22 May 2017 14:43:24 -0700 Subject: [PATCH 1/3] Add file hashing for static files Signed-off-by: Eli Uriegas Upstream-commit: a1b7f6f3407546ff41ed2e0d16d7e1b2a8ac0ef4 Component: packaging --- components/packaging/static/Makefile | 5 +++++ components/packaging/static/hash_files | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 components/packaging/static/hash_files diff --git a/components/packaging/static/Makefile b/components/packaging/static/Makefile index 14711884eb..b4be5efd80 100644 --- a/components/packaging/static/Makefile +++ b/components/packaging/static/Makefile @@ -4,6 +4,7 @@ CLI_DIR:=$(CURDIR)/../../cli ENGINE_VER=$(shell cat $(ENGINE_DIR)/VERSION) VERSION=$(shell cat $(ENGINE_DIR)/VERSION) CHOWN=docker run --rm -v $(CURDIR):/v -w /v alpine chown +HASH_CMD=docker run -v $(CURDIR):/sum -it -w /sum debian:jessie bash hash_files .PHONY: help clean static static-linux cross-mac cross-win cross-arm static-cli static-engine cross-all-cli cross-win-engine @@ -23,11 +24,13 @@ static-linux: static-cli static-engine ## create tgz with linux x86_64 client an cp $(ENGINE_DIR)/bundles/$(ENGINE_VER)/binary-daemon/$$f build/linux/docker; \ done tar -C build/linux -c -z -f build/linux/docker-$(VERSION).tgz docker + $(HASH_CMD) build/linux cross-mac: cross-all-cli ## create tgz with darwin x86_64 client only mkdir -p build/mac/docker cp $(CLI_DIR)/build/docker-darwin-amd64 build/mac/docker/docker tar -C build/mac -c -z -f build/mac/docker-$(VERSION).tgz docker + $(HASH_CMD) build/mac cross-win: cross-all-cli cross-win-engine ## create zip file with windows x86_64 client and server mkdir -p build/win/docker @@ -35,11 +38,13 @@ cross-win: cross-all-cli cross-win-engine ## create zip file with windows x86_64 cp $(ENGINE_DIR)/bundles/$(ENGINE_VER)/cross/windows/amd64/dockerd-$(ENGINE_VER).exe build/win/docker/dockerd.exe docker run --rm -v $(CURDIR)/build/win:/v -w /v alpine sh -c 'apk update&&apk add zip&&zip -r docker-$(VERSION).zip docker' $(CHOWN) -R $(shell id -u):$(shell id -g) build + $(HASH_CMD) bash hash_files build/win 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-$(VERSION).tgz docker + $(HASH_CMD) build/arm static-cli: $(MAKE) -C $(CLI_DIR) -f docker.Makefile VERSION=$(VERSION) build diff --git a/components/packaging/static/hash_files b/components/packaging/static/hash_files new file mode 100644 index 0000000000..a8851fcc0e --- /dev/null +++ b/components/packaging/static/hash_files @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# Simple script to hash all the files in a given directory + +DIR_TO_LOOK_IN=${1:-build/linux} + +for f in $(find "$DIR_TO_LOOK_IN" -type f); do + for hash_algo in md5 sha256; do + "${hash_algo}sum" "$f" > "$f.$hash_algo" + done +done From fe481b52a5ca067f45c7ad5b05c6ad9f59f39430 Mon Sep 17 00:00:00 2001 From: Eli Uriegas Date: Mon, 22 May 2017 15:11:53 -0700 Subject: [PATCH 2/3] Move the hashing of files to its own target So we can use it at will Signed-off-by: Eli Uriegas Upstream-commit: 533a843393bd7c3674074ec9af73c8e666fc7484 Component: packaging --- components/packaging/static/Makefile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/components/packaging/static/Makefile b/components/packaging/static/Makefile index b4be5efd80..1c8d25d952 100644 --- a/components/packaging/static/Makefile +++ b/components/packaging/static/Makefile @@ -5,8 +5,9 @@ ENGINE_VER=$(shell cat $(ENGINE_DIR)/VERSION) VERSION=$(shell cat $(ENGINE_DIR)/VERSION) CHOWN=docker run --rm -v $(CURDIR):/v -w /v alpine chown HASH_CMD=docker run -v $(CURDIR):/sum -it -w /sum debian:jessie bash hash_files +DIR_TO_HASH:=build/linux -.PHONY: help clean static static-linux cross-mac cross-win cross-arm static-cli static-engine cross-all-cli cross-win-engine +.PHONY: help clean static static-linux cross-mac cross-win cross-arm static-cli static-engine cross-all-cli cross-win-engine hash_files help: ## show make targets @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) @@ -24,13 +25,15 @@ static-linux: static-cli static-engine ## create tgz with linux x86_64 client an cp $(ENGINE_DIR)/bundles/$(ENGINE_VER)/binary-daemon/$$f build/linux/docker; \ done tar -C build/linux -c -z -f build/linux/docker-$(VERSION).tgz docker - $(HASH_CMD) build/linux + +hash_files: + @echo "Hashing directory $(DIR_TO_HASH)" + $(HASH_CMD) "$(DIR_TO_HASH)" cross-mac: cross-all-cli ## create tgz with darwin x86_64 client only mkdir -p build/mac/docker cp $(CLI_DIR)/build/docker-darwin-amd64 build/mac/docker/docker tar -C build/mac -c -z -f build/mac/docker-$(VERSION).tgz docker - $(HASH_CMD) build/mac cross-win: cross-all-cli cross-win-engine ## create zip file with windows x86_64 client and server mkdir -p build/win/docker @@ -38,13 +41,11 @@ cross-win: cross-all-cli cross-win-engine ## create zip file with windows x86_64 cp $(ENGINE_DIR)/bundles/$(ENGINE_VER)/cross/windows/amd64/dockerd-$(ENGINE_VER).exe build/win/docker/dockerd.exe docker run --rm -v $(CURDIR)/build/win:/v -w /v alpine sh -c 'apk update&&apk add zip&&zip -r docker-$(VERSION).zip docker' $(CHOWN) -R $(shell id -u):$(shell id -g) build - $(HASH_CMD) bash hash_files build/win 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-$(VERSION).tgz docker - $(HASH_CMD) build/arm static-cli: $(MAKE) -C $(CLI_DIR) -f docker.Makefile VERSION=$(VERSION) build From b602250a48b25418989f0b3554bd77de87cf6dae Mon Sep 17 00:00:00 2001 From: Andrew Hsu Date: Tue, 23 May 2017 03:19:52 +0000 Subject: [PATCH 3/3] more doc cleanup Signed-off-by: Andrew Hsu Upstream-commit: dafbbb4fa4fbaade4ae0a6abcba39bbfcd8f755d Component: packaging --- components/packaging/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/components/packaging/README.md b/components/packaging/README.md index f0254edb1c..1acf87360e 100644 --- a/components/packaging/README.md +++ b/components/packaging/README.md @@ -1,20 +1,20 @@ # Docker CE Packaging -This repo contains open source scripts for packaging the +This repo contains the open source scripts for packaging [Docker CE products](https://store.docker.com/search?offering=community&q=&type=edition). This repository is solely maintained by Docker, Inc. The scripts will build for this list of packages types: -* DEB packages for Ubuntu Trusty 14.04 -* DEB packages for Ubuntu Xenial 16.04 -* DEB packages for Ubuntu Yakkety 16.10 -* DEB packages for Ubuntu Zesty 17.04 -* DEB packages for Debian Stretch -* DEB packages for Debian Jessie -* DEB packages for Debian Wheezy -* RPM packages for Fedora 24 +* DEB packages for Ubuntu 17.04 Zesty +* DEB packages for Ubuntu 16.10 Yakkety +* DEB packages for Ubuntu 16.04 Xenial +* DEB packages for Ubuntu 14.04 Trusty +* DEB packages for Debian 9 Stretch +* DEB packages for Debian 8 Jessie +* DEB packages for Debian 7 Wheezy * RPM packages for Fedora 25 +* RPM packages for Fedora 24 * RPM packages for CentOS 7 * TGZ and ZIP files with static binaries