diff --git a/bin/compose-core b/bin/compose-core index 28de05e..2ea12d2 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -560,10 +560,6 @@ ensure_db_docker_running () { fi docker_opts= - if [ -f "$DB_PASSFILE" ]; then - verb "Found and using '$DB_PASSFILE'." - docker_opts="$db_docker_opts -v $SERVER_ROOT_PREFIX$DB_PASSFILE:$DB_PASSFILE" - fi debug docker network create "$_DB_NAME" if ! network_id=$(docker network create "$_DB_NAME"); then err "'docker network create' failed !" @@ -619,18 +615,20 @@ _dcmd() { debug "Db> $command $@" - if [ -f "$DB_PASSFILE" ]; then - verb "Found and using '$DB_PASSFILE'." - db_docker_opts="$db_docker_opts -v $SERVER_ROOT_PREFIX$DB_PASSFILE:$DB_PASSFILE" + if [ -f "$HOST_DB_PASSFILE" -a "$CLIENT_DB_PASSFILE" ]; then + verb "Found and using '$HOST_DB_PASSFILE' as '$CLIENT_DB_PASSFILE'." + docker_opts=("${db_docker_opts[@]}" "-v" "$HOST_DB_PASSFILE:$CLIENT_DB_PASSFILE") + else + docker_opts=("${db_docker_opts[@]}") fi ## XXXX was here: actualy, we need only connection between this version and the client version debug docker run -i --rm \ - $db_docker_opts \ - --entrypoint "$command" "$DOCKER_BASE_IMAGE" $db_cmd_opts "$@" + "${docker_opts[@]}" \ + --entrypoint "$command" "$DOCKER_BASE_IMAGE" "${db_cmd_opts[@]}" "$@" docker run -i --rm \ - $db_docker_opts \ - --entrypoint "$command" "$DOCKER_BASE_IMAGE" $db_cmd_opts "$@" + "${docker_opts[@]}" \ + --entrypoint "$command" "$DOCKER_BASE_IMAGE" "${db_cmd_opts[@]}" "$@" } export -f _dcmd