From 7b16c07c7fa7d46ed782f7a922bda453624a555f Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 28 Nov 2018 09:29:58 +0100 Subject: [PATCH] fix: avoid leaking stopped containers --- bin/compose | 2 +- bin/compose-core | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/compose b/bin/compose index 2d09dea..ee482d7 100755 --- a/bin/compose +++ b/bin/compose @@ -202,7 +202,7 @@ run() { if [ -t 1 ]; then docker_run_opts+=("-ti") fi - exec docker run "${docker_run_opts[@]}" "${COMPOSE_DOCKER_IMAGE}" "$@" + exec docker run --rm "${docker_run_opts[@]}" "${COMPOSE_DOCKER_IMAGE}" "$@" } diff --git a/bin/compose-core b/bin/compose-core index 2f417df..4360c29 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -295,7 +295,7 @@ cmd_on_base_image() { local service="$1" base_image shift base_image=$(service_base_docker_image "$service") || return 1 - docker run -i --entrypoint /bin/bash "$base_image" -c "$*" + docker run -i --rm --entrypoint /bin/bash "$base_image" -c "$*" } export -f cmd_on_base_image @@ -2244,7 +2244,7 @@ docker_run_opts+=( docker_run_opts+=("-ti") } -exec docker run "\${docker_run_opts[@]}" "${COMPOSE_DOCKER_IMAGE:-docker.0k.io/compose}" "\$@" +exec docker run --rm "\${docker_run_opts[@]}" "${COMPOSE_DOCKER_IMAGE:-docker.0k.io/compose}" "\$@" EOF