summaryrefslogtreecommitdiffhomepage
path: root/images/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'images/Makefile')
-rw-r--r--images/Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/images/Makefile b/images/Makefile
index 1485607bd..278dec02f 100644
--- a/images/Makefile
+++ b/images/Makefile
@@ -34,8 +34,15 @@ list-all-images:
@for image in $(ALL_IMAGES); do echo $${image}; done
.PHONY: list-build-images
+# Handy wrapper to allow load-all-images, push-all-images, etc.
%-all-images:
@$(MAKE) $(patsubst %,$*-%,$(ALL_IMAGES))
+load-all-images:
+ @$(MAKE) $(patsubst %,load-%,$(ALL_IMAGES))
+
+# Handy wrapper to load specified "groups", e.g. load-basic-images, etc.
+load-%-images:
+ @$(MAKE) $(patsubst %,load-%,$(subst /,_,$(subst ./,,$(shell find ./$* -name Dockerfile -exec dirname {} \;))))
# tag is a function that returns the tag name, given an image.
#
@@ -52,9 +59,9 @@ local_image = $(LOCAL_IMAGE_PREFIX)/$(subst _,/,$(1))
# we need to explicitly repull the base layer in order to ensure that the
# architecture is correct. Note that we use the term "rebuild" here to avoid
# conflicting with the bazel "build" terminology, which is used elsewhere.
+rebuild-%: FROM=$(shell grep FROM $(call path,$*)/Dockerfile } cut -d' ' -f2)
rebuild-%: register-cross
- FROM=$(shell grep FROM $(call path,$*)/Dockerfile | cut -d' ' -f2-) && \
- docker pull $(DOCKER_PLATFORM_ARGS) $$FROM
+ $(foreach IMAGE,$(FROM),docker $(DOCKER_PLATFORM_ARGS) $(IMAGE); &&) true
T=$$(mktemp -d) && cp -a $(call path,$*)/* $$T && \
docker build $(DOCKER_PLATFORM_ARGS) -t $(call remote_image,$*) $$T && \
rm -rf $$T