-
Notifications
You must be signed in to change notification settings - Fork 160
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (43 loc) · 1.9 KB
/
Makefile
File metadata and controls
54 lines (43 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
include ../common.mk
CLI_DIR=$(realpath $(CURDIR)/../src/github.com/docker/cli)
ENGINE_DIR=$(realpath $(CURDIR)/../src/github.com/docker/docker)
BUILDX_DIR=$(realpath $(CURDIR)/../src/github.com/docker/buildx)
COMPOSE_DIR=$(realpath $(CURDIR)/../src/github.com/docker/compose)
ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD)
GEN_STATIC_VER=$(shell ./gen-static-ver $(CLI_DIR) $(VERSION))
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
DIR_TO_HASH:=build/linux
# Select the default version of containerd and runc based on the docker engine
# source we need this variable here for naming the produced .tgz file.
CONTAINERD_VERSION?=$(shell grep "ARG CONTAINERD_VERSION" "$(ENGINE_DIR)/Dockerfile" | awk -F'=' '{print $$2}')
RUNC_VERSION?=$(shell grep "ARG RUNC_VERSION" "$(ENGINE_DIR)/Dockerfile" | awk -F'=' '{print $$2}')
export CLI_DIR
export ENGINE_DIR
export BUILDX_DIR
export COMPOSE_DIR
export GEN_STATIC_VER
export CONTAINERD_VERSION
export RUNC_VERSION
export REF
export DOCKER_CLI_REF
export DOCKER_ENGINE_REF
export DOCKER_SCAN_REF
export DOCKER_BUILDX_REF
export DOCKER_COMPOSE_REF
export GO_VERSION
.PHONY: help
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)
.PHONY: clean
clean: ## remove build artifacts
@[ ! -d build ] || $(CHOWN) -R $(shell id -u):$(shell id -g) build
@$(RM) -r build
.PHONY: create_builder
create_builder: # create docker-container builder
docker buildx inspect | tr -d ' ' | grep -q 'Driver:docker-container' || docker buildx create --use --bootstrap
.PHONY: build
build: create_builder ## build static package
CURDIR=$(CURDIR) STATICOS=$(STATICOS) STATICARCH=$(STATICARCH) ./build-static
.PHONY: hash_files
hash_files: ## hash files
$(HASH_CMD) "$(DIR_TO_HASH)"