From e5032a611bb8ec65b6ca6a851be09c5718d0c949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Mon, 16 Sep 2019 11:01:02 +0200 Subject: [PATCH] makefiles/docker.inc.mk: add a 'docker_volume' function Refactor the '--volume' mounting handling. This prepares for using a global 'DOCKER_VOLUME_OPTIONS'. --- makefiles/docker.inc.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/makefiles/docker.inc.mk b/makefiles/docker.inc.mk index 5edceac465..5776065a96 100644 --- a/makefiles/docker.inc.mk +++ b/makefiles/docker.inc.mk @@ -198,6 +198,11 @@ endef # Arguments are the same as 'path_in_docker' # If the 'directories' variable is empty, it will not be exported to docker +# docker_volume command line arguments. Allows giving volume mount options. +# By default 'DOCKER_VOLUME_OPTIONS'. Argument option ignore the default. +DOCKER_VOLUME_OPTIONS ?= +docker_volume = -v '$1:$2$(addprefix :,$(or $3,$(DOCKER_VOLUME_OPTIONS)))' + docker_volume_and_env = $(strip $(call _docker_volume_and_env,$1,$2,$3)) define _docker_volume_and_env $(call docker_volumes_mapping,$($1),$2,$3)