Docker exec command output in detach mode

I am trying to run a jar file inside a running container. I use this command for this docker exec -t -d [containerID] java -jar jarname.jar

. The command completed successfully, but I cannot see it. Docker allocates a new tty on the host, but how can I see its output? What am I doing wrong?

+3


source to share


1 answer


How about removing the flag -d

, then you get the output to stdout.

Shell redirection and background actions in docker command can be used as needed.



I would also remove the '-t' flag if your Java program doesn't need a tty.

+2


source







All Articles