I need to know the output of some exec docker commands in my shell script, for example, I have a nginx container and in my script I run:
docker exec -it containerName /etc/init.d/nginx configtest
I want to continue running the script only if the nginx configuration check succeeds and not fail.
I tried to use $? , but it is 0 , even then configuretest output does not work (since docker exec succeeds, as I understand it).
source share