diff --git a/bin/compose b/bin/compose index 4ac1cfc..96e6459 100755 --- a/bin/compose +++ b/bin/compose @@ -2960,7 +2960,12 @@ case "$action" in config) ## removing the services services=($(get_master_services "${action_posargs[@]}")) || exit 1 - launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${remainder_args[@]}" + ## forcing docker-compose config to output the config file to stdout and not stderr + out=$(launch_docker_compose "${compose_opts[@]}" "$action" "${action_opts[@]}" "${remainder_args[@]}" 2>&1) || { + echo "$out" + exit 1 + } + echo "$out" warn "Runtime configuration modification (from relations) are not included here." ;; down) diff --git a/test/base b/test/base index 15b2e23..3850c47 100755 --- a/test/base +++ b/test/base @@ -1243,7 +1243,22 @@ EOF2 cd "$test_tmpdir" export DISABLE_SYSTEM_CONFIG_FILE=true -"$tprog" config +out=\$("$tprog" config) || exit 1 +expected="networks: + static: + driver: bridge + ipam: + config: + - subnet: 172.25.1.0/24 + driver: default +services: {} +version: '2.0'" + +[ "\$out" == "\$expected" ] || { + echo -e "DIFF:\n\$(diff <(echo "\$out") <(echo "\$expected"))" + exit 1 +} + ## -- simple service provided