Browse Source

fix: avoid leaking stopped containers

test
Valentin Lab 6 years ago
parent
commit
7b16c07c7f
  1. 2
      bin/compose
  2. 4
      bin/compose-core

2
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}" "$@"
}

4
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

Loading…
Cancel
Save