Browse Source

fix: keep ``COMPOSE_DOCKER_IMAGE`` in subcalls.

checking
Valentin Lab 5 years ago
parent
commit
c9f8f2b3e4
  1. 12
      bin/compose

12
bin/compose

@ -167,6 +167,9 @@ mk_docker_run_options() {
docker_run_opts+=("-v" "$HOME/.docker:/root/.docker")
COMPOSE_DOCKER_IMAGE=${COMPOSE_DOCKER_IMAGE:-docker.0k.io/compose}
docker_run_opts+=("-e" "COMPOSE_DOCKER_IMAGE=$COMPOSE_DOCKER_IMAGE")
COMPOSE_LAUNCHER_BIN=$(readlink -f "${BASH_SOURCE[0]}")
filename=$(mktemp -p /tmp/ -t launch_opts-XXXXXXXXXXXXXXXX)
@ -196,9 +199,16 @@ run() {
while read-0 opt; do
docker_run_opts+=("$opt")
## catch COMPOSE_DOCKER_IMAGE
if [[ "$env" == "true" && "$opt" == "COMPOSE_DOCKER_IMAGE="* ]]; then
COMPOSE_DOCKER_IMAGE=${opt##COMPOSE_DOCKER_IMAGE=}
elif [ "$opt" == "-e" ]; then
env=true
else
env=
fi
done < <(cat "$COMPOSE_LAUNCHER_OPTS")
COMPOSE_DOCKER_IMAGE=${COMPOSE_DOCKER_IMAGE:-docker.0k.io/compose}
if [ -t 0 ]; then
docker_run_opts+=("-i")
fi

Loading…
Cancel
Save