From 5f22c758751f552c6fcf318bcfe91ff686d5ed27 Mon Sep 17 00:00:00 2001 From: nosamad Date: Sat, 6 Apr 2019 02:36:15 +0200 Subject: [PATCH] removes duplicate options --- Makefile | 7 ++----- build/run_image.sh.template | 4 +++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index a067660..27c7c61 100644 --- a/Makefile +++ b/Makefile @@ -149,8 +149,6 @@ DOCKER_RUNFLAGS += --security-opt apparmor:unconfined DOCKER_RUNFLAGS += --cap-add SYS_PTRACE DOCKER_RUNFLAGS += --security-opt seccomp=unconfined -DOCKER_RUNFLAGS += --interactive -DOCKER_RUNFLAGS += --rm DOCKER_RUNFLAGS += --user $(CONTAINER_USER):$(CONTAINER_GROUP) DOCKER_RUNFLAGS += --env SOURCE_DATE_EPOCH DOCKER_RUNFLAGS += --env BUILDTIME @@ -163,7 +161,6 @@ DOCKER_BUILDARGS += PROJECT_ROOT=$(CONTAINER_PROJECT_ROOT) DOCKER_BUILDARGS += OUT=$(CONTAINER_OUT) DOCKER_BUILDARGS += REGISTRY_PREFIX=$(REGISTRY_PREFIX) -DOCKER_BUILDFLAGS += --rm DOCKER_BUILDFLAGS += $(addprefix --build-arg ,$(DOCKER_BUILDARGS)) OUT_TARGETS += $(addprefix $(OUT)/,$(TARGETS)) @@ -221,7 +218,7 @@ $(HOST_CONTAINER)image_run_volumes += --volume '$(realpath $(OUT)/$1):$(CONTAINE image_run_volumes += $(addprefix --volumes-from ,$2) image_name = $(REGISTRY_PREFIX)$(subst -,/,$1)/$(PROJECT_NAME):$(VERSION) -image_run = $(DOCKER) run $(DOCKER_RUNFLAGS) \ +image_run = $(DOCKER) run --rm --interactive $(DOCKER_RUNFLAGS) \ $(call image_run_volumes,$1,$(HOST_CONTAINER)) \ $(addprefix --cgroup-parent ,$(CONTAINER_CGROUP_PARENT)) \ --workdir '$(CONTAINER_OUT)/$1/$(BUILDTYPE)' \ @@ -234,7 +231,7 @@ image_rule = \ $$(SILENT)$$(call image,$1) image = \ $(call echo_if_silent,TARGET=$1 docker build $(call image_name,$1) $(OUT)) \ - && $(DOCKER) build $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(call image_name,$1) $(OUT) + && $(DOCKER) build --rm $(DOCKER_BUILDFLAGS) --iidfile $@ --file $< --tag $(call image_name,$1) $(OUT) configure_rule = \ $$(OUT)/$1/$$(BUILDTYPE)/CMakeCache.txt: $$(PROJECT_ROOT)/CMakeLists.txt $$(OUT)/docker/$1 | $$(OUT)/$1/$$(BUILDTYPE)/gdbserver; \ diff --git a/build/run_image.sh.template b/build/run_image.sh.template index 9fc6b8f..6712a5d 100644 --- a/build/run_image.sh.template +++ b/build/run_image.sh.template @@ -34,6 +34,8 @@ if [ -n "$HOST_CONTAINER" ]; then set -- --volumes-from "$HOST_CONTAINER" "$@" fi +set -- %RUNFLAGS% "$@" + if [ -t 0 ] && ! "$SCRIPT_ROOT/is_running_in_bg.sh" $$; then set -- --interactive "$@" fi @@ -45,6 +47,6 @@ elif [ -t 1 ]; then set -- --tty "$@" fi -set -- %RUNFLAGS% "$@" +set -- --rm "$@" exec "$DOCKER" run "$@"