diff options
| author | Joe Carstairs <me@joeac.net> | 2026-07-01 18:31:34 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-07-01 18:31:34 +0100 |
| commit | c7c8a96a572dd04c3aff44284c4c46da04deaa37 (patch) | |
| tree | 9318ff98f197a1a948e651d12116983019dedcb6 /make/container.mk | |
| parent | f73512107c7cf8d95fb1f97fa69706a1519e5ca3 (diff) | |
moves helper makefiles into make/ dir
Diffstat (limited to 'make/container.mk')
| -rw-r--r-- | make/container.mk | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/make/container.mk b/make/container.mk new file mode 100644 index 0000000..101e4e4 --- /dev/null +++ b/make/container.mk @@ -0,0 +1,27 @@ +CPU_ARCH := $(if $(shell which arch 2>/dev/null),\ + $(shell arch),\ + $(shell lscpu | grep ^Architecture: | sed "s/^Architecture:[[:space:]]*\([[:alnum:][:punct:]]\+\).*/\1/")) +IMAGE_PREFIX := $(if $(filter armv7%,$(CPU_ARCH)),armv7/) +REGISTRY_DOMAIN := git.joeac.net +REGISTRY_USER := joeac + +container_image_name = $(REGISTRY_DOMAIN)/$(REGISTRY_USER)/$(CONTAINER_PREFIX)joeac.net-$(module) + +define build_module_rule = +.PHONY: build_$(module) +build_$(module): make_$(module) $(module).Dockerfile + IMAGE_PREFIX="$(IMAGE_PREFIX)" podman-compose build $(module) +endef + +define push_module_rule = +.PHONY: push_$(module) +push_$(module): login_registry build_$(module) + podman push $(container_image_name) +endef + +$(foreach module,$(COMPOSE_SERVICES),$(eval $(call build_module_rule))) +$(foreach module,$(COMPOSE_SERVICES),$(eval $(call push_module_rule))) + +.PHONY: login_registry +login_registry: + podman login $(REGISTRY_DOMAIN) |
