@@ -16,7 +16,8 @@ ifdef BUILD_IMAGE
1616endif
1717
1818COMMON_FILES =common
19- BUILD? =docker build \
19+ BUILD?=DOCKER_BUILDKIT =1 \
20+ docker build \
2021 $(BUILD_IMAGE_FLAG ) \
2122 --build-arg GO_IMAGE=$(GO_IMAGE ) \
2223 --build-arg COMMON_FILES=$(COMMON_FILES ) \
@@ -34,9 +35,14 @@ RUN=docker run --rm -i \
3435 $(RUN_FLAGS ) \
3536 debbuild-$@ /$(ARCH )
3637
37- SOURCE_FILES =engine-image cli.tgz engine.tgz docker.service docker.socket distribution_based_engine.json plugin-installers.tgz
38+ SOURCE_FILES =cli.tgz engine.tgz docker.service docker.socket plugin-installers.tgz
3839SOURCES =$(addprefix sources/, $(SOURCE_FILES ) )
3940
41+ DEBIAN_VERSIONS := debian-stretch debian-buster
42+ UBUNTU_VERSIONS := ubuntu-xenial ubuntu-bionic ubuntu-cosmic ubuntu-disco
43+ RASPBIAN_VERSIONS := raspbian-stretch raspbian-buster
44+ DISTROS := $(DEBIAN_VERSIONS ) $(UBUNTU_VERSIONS ) $(RASPBIAN_VERSIONS )
45+
4046.PHONY : help
4147help : # # show make targets
4248 @awk ' BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST )
@@ -47,41 +53,22 @@ clean: ## remove build artifacts
4753 $(RM ) -r debbuild
4854 [ ! -d sources ] || $(CHOWN ) -R $(shell id -u) :$(shell id -g) sources
4955 $(RM ) -r sources
50- $(RM ) engine-image
51-
52- engine-$(ARCH ) .tar :
53- $(MAKE ) -C ../image image-linux
54- docker save -o $@ $$(cat ../image/image-linux )
5556
5657.PHONY : deb
57- deb : ubuntu debian raspbian # # build all deb packages
58+ deb : ubuntu debian # # build all deb packages except for raspbian
5859
5960.PHONY : ubuntu
60- ubuntu : ubuntu-bionic ubuntu-xenial ubuntu-disco ubuntu-eoan # # build all ubuntu deb packages
61+ ubuntu : $( UBUNTU_VERSIONS ) # # build all ubuntu deb packages
6162
6263.PHONY : debian
63- debian : debian-stretch debian-buster # # build all debian deb packages
64+ debian : $( DEBIAN_VERSIONS ) # # build all debian deb packages
6465
6566.PHONY : raspbian
66- raspbian : raspbian-stretch raspbian-buster # # build all raspbian deb packages
67-
68- .PHONY : ubuntu-%
69- # # build ubuntu deb packages
70- ubuntu-% : $(SOURCES )
71- $(BUILD )
72- $(RUN )
73- $(CHOWN ) -R $(shell id -u) :$(shell id -g) debbuild/$@
74-
75- .PHONY : debian-%
76- # # build debian deb packages
77- debian-% : $(SOURCES )
78- $(BUILD )
79- $(RUN )
80- $(CHOWN ) -R $(shell id -u) :$(shell id -g) debbuild/$@
67+ raspbian : $(RASPBIAN_VERSIONS ) # # build all raspbian deb packages
8168
82- .PHONY : raspbian- %
83- # # build raspbian deb packages
84- raspbian- % : $( SOURCES )
69+ .PHONY : $( DISTROS )
70+ $( DISTROS ) : $( SOURCES )
71+ @echo " == Building packages for $@ == "
8572 $(BUILD )
8673 $(RUN )
8774 $(CHOWN ) -R $(shell id -u) :$(shell id -g) debbuild/$@
@@ -110,18 +97,6 @@ sources/docker.socket: ../systemd/docker.socket
11097 mkdir -p $(@D )
11198 cp $< $@
11299
113- # TODO: Figure out how to decouple this
114- # TODO: These might just end up being static files that are hardcoded
115- # TODO: FROM HERE <=====================
116- sources/distribution_based_engine.json : sources/engine-image
117- mkdir -p $(@D )
118- echo ' {"platform":"Docker Engine - Community","engine_image":"engine-community","containerd_min_version":"1.2.0-beta.1","runtime":"host_install"}' > $@
119-
120- sources/engine-image :
121- mkdir -p $(@D )
122- echo " docker.io/dockereng/engine-community:$( STATIC_VERSION) " > $@
123- # TODO: TO HERE <=====================
124-
125100sources/plugin-installers.tgz : $(wildcard ../plugins/* )
126101 docker run --rm -i -w /v \
127102 -v $(PLUGINS_DIR ) :/plugins \
0 commit comments