Hello @philpep, currently I work on the same task - automation for a large docker repo. Your article https://philpep.org/blog/a-makefile-for-your-dockerfiles was very helpful for me, this is a really brilliant solution 馃憤
And recently I discovered a bit simpler way to build dependencies than including extra makefile (I work with docker files paths directly, without intermediate variable):
define build-dependencies
$(1): $(shell \
cat $(1) \
| grep -E '^FROM *$(registry)/$(base-tag)/[^ :]*($$| )' -o \
| sed 's|FROM *$(registry)/$(base-tag)/||' \
| sed -E 's| ?$$|/Dockerfile|')
endef
$(foreach file,$(docker-files),$(eval $(call build-dependencies,$(file))))
As you can see, eval works like include, and other targets work as expected. Also, you don't need to maintain .depends.mk file. For debug purposes, you can replace eval with info.
Hope this helps 馃槃
Hello @philpep, currently I work on the same task - automation for a large docker repo. Your article https://philpep.org/blog/a-makefile-for-your-dockerfiles was very helpful for me, this is a really brilliant solution 馃憤
And recently I discovered a bit simpler way to build dependencies than including extra makefile (I work with docker files paths directly, without intermediate variable):
As you can see, eval works like include, and other targets work as expected. Also, you don't need to maintain .depends.mk file. For debug purposes, you can replace eval with info.
Hope this helps 馃槃