diff --git a/Makefile b/Makefile index 72fe74c..6561fee 100644 --- a/Makefile +++ b/Makefile @@ -3,18 +3,32 @@ define INC_DOCKER = endef $(info Defined INC_DOCKER) -include /devel/docker/docker_vars.sh +docker_src = /devel/docker +include ${docker_src}/docker_vars.sh export +# A container is built based on a given Dockerfile. +# We mark a sentinel when a container is built. ${docker_src}/built/%.sentinel: ${docker_src}/%.dockerfile grep -e '^FROM' $< | awk '{print $$2}' \ | tr : _ | xargs -I{} $(MAKE) ${docker_src}/built/{}.sentinel; cd ${docker_src}; docker build -f $< --tag $* .; touch $@; +# Exceptions to this rule are listed below, but should handle the rule +# the same ways. ${docker_src}/built/debian_10.sentinel: docker pull "debian:10" && touch $@; +# For example, the main openwrt builder container is built specific to +# a remote and a commit. [Basing this container on a main +# openwrt-builder container still saves us time as OpenWrt reomtes +# reliably share almost all of the same history.] +## +# Two formats are accepted: openwrt-builder-${rev}.sentinel for the +# base builder on the default remote at a particular revision, and +# openwrt-builder-${remote}_${rev}.sentinel to construct the builder +# pointing to a particular remote at a particular revision. ${docker_src}/built/openwrt-builder-%.sentinel: \ ${docker_src}/openwrt-builder-commit.dockerfile \ ${docker_src}/built/openwrt-builder.sentinel \