-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
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 π
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels