@@ -21,10 +21,6 @@ DOCKER_SOCK ?= /var/run/docker.sock
21
21
DOCKER_SOCKS := -v $(PODMAN_SOCK ) :$(PODMAN_SOCK ) :ro -v $(DOCKER_SOCK ) :$(DOCKER_SOCK ) :ro
22
22
DOCKER_OPTS := --rm -e TZ="${TZ}" -e GLANCES_OPT="" --pid host --network host
23
23
24
- define DOCKER_TAG
25
- glances:local-$*
26
- endef
27
-
28
24
# if the command is only `make`, the default tasks will be the printing of the help.
29
25
.DEFAULT_GOAL := help
30
26
@@ -224,16 +220,12 @@ snapcraft:
224
220
# Need Docker Buildx package (apt install docker-buildx on Ubuntu)
225
221
# ===================================================================
226
222
227
- define DOCKERFILE
228
- docker-files/$(word 1,$(subst -, ,$* ) ) .Dockerfile
229
- endef
230
-
231
- define TARGET
232
- $(word 2,$(subst -, ,$* ) )
223
+ define MAKE_DOCKER_BUILD_RULES
224
+ $($(DISTRO ) _images) : docker-$(DISTRO ) -%: docker-files/$(DISTRO ) .Dockerfile
225
+ $(DOCKER_BUILD ) --target $$* -f $$< -t glances:local-$(DISTRO ) -$$* .
233
226
endef
234
227
235
- $(DOCKER_IMAGES ) : docker-% :
236
- $(DOCKER_BUILD ) --target $(TARGET ) -f $(DOCKERFILE ) -t $(DOCKER_TAG ) .
228
+ $(foreach DISTRO,$(DISTROS),$(eval $(MAKE_DOCKER_BUILD_RULES)))
237
229
238
230
docker : docker-alpine docker-ubuntu # # Generate local docker images
239
231
@@ -273,7 +265,7 @@ run-min-local-conf: ## Start minimal Glances in console mode with the system con
273
265
$(VENV_MIN ) /python -m glances
274
266
275
267
$(DOCKER_RUNTIMES ) : run-docker-% :
276
- $(DOCKER_RUN ) $(DOCKER_OPTS ) $(DOCKER_SOCKS ) -it $( DOCKER_TAG )
268
+ $(DOCKER_RUN ) $(DOCKER_OPTS ) $(DOCKER_SOCKS ) -it glances:local- $*
277
269
278
270
run-docker-alpine-minimal : # # Start Glances Alpine Docker minimal in console mode
279
271
run-docker-alpine-full : # # Start Glances Alpine Docker full in console mode
0 commit comments