user2419952
user2419952

Reputation: 41

Docker output of exec command in detach mode

I'm trying to start a jar file inside a running container. In order to do this I use this command docker exec -t -d [containerID] java -jar jarname.jar. The command is successfully executed but I am unable to see its output. Docker allocates a new tty in the host but how can I see its output? What am I doing wrong?

Upvotes: 4

Views: 4623

Answers (1)

Bryan
Bryan

Reputation: 12190

How about removing the -d flag, then you will get the output on stdout.

Can use shell redirection and backgrounding on the docker command if needed.

I would also remove the '-t' flag unless your Java program specifically needs a tty.

Upvotes: 3

Related Questions