-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
52 lines (40 loc) · 1.71 KB
/
Makefile
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
GITHASH := afdb6d4
VERSION := 17.09.0-ce
ARCHIVE := docker-$(VERSION).tgz
HASH := docker-$(VERSION).hash
CLI := docker-ce/components/cli/build/docker
ENGINE := \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/docker-containerd \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/docker-containerd-ctr \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/docker-containerd-shim \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/docker-init \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/docker-proxy \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/docker-runc \
docker-ce/components/engine/bundles/$(VERSION)/binary-daemon/dockerd
BINARIES := $(CLI) $(ENGINE)
all: $(ARCHIVE) $(HASH)
$(HASH): $(ARCHIVE)
echo -n "sha256 " > $@
sha256sum $(ARCHIVE) >> $@
$(ARCHIVE): $(BINARIES)
rm -rf docker-ce/bundles/$(VERSION)/docker
mkdir -p docker-ce/bundles/$(VERSION)/docker
cp $^ docker-ce/bundles/$(VERSION)/docker/
tar zcvf $@ -C docker-ce/bundles/$(VERSION)/ docker
$(CLI): | docker-cli-builder docker-ce
cd docker-ce && git fetch && git checkout $(GITHASH)
docker run -t --rm -e VERSION=$(VERSION) -e GITCOMMIT=$(GITHASH) \
-v $(CURDIR)/docker-ce/components/cli:/go/src/github.com/docker/cli docker-cli-builder make
$(ENGINE): | docker-ce
cd docker-ce && git fetch && git checkout $(GITHASH)
$(MAKE) -C docker-ce/components/engine binary
docker-cli-builder:
docker build -t docker-cli-builder docker-cli-builder
docker-ce:
git clone https://github.com/docker/docker-ce.git
clean:
$(RM) $(ARCHIVE) $(HASH) $(BINARIES)
distclean: clean
$(RM) -r docker-ce
docker rmi docker-cli-builder
.PHONY: all docker-cli-builder clean distclean