How to get docker exec stdout to be as verbose as running command in container?

Viewed 17944

If I run a command using docker's exec command, like so:

docker exec container gulp

It simply runs the command, but nothing is outputted to my terminal window.

However, if I actually go into the container and run the command manually:

docker exec -ti container bash
gulp

I see gulp's output:

[13:49:57] Using gulpfile ~/code/services/app/gulpfile.js
[13:49:57] Starting 'scripts'...
[13:49:57] Starting 'styles'...
[13:49:58] Starting 'emailStyles'...
...

How can I run my first command and still have the output sent to my terminal window?

Side note: I see the same behavior with npm installs, forever restarts, etc. So, it is not just a gulp issue, but likely something with how docker is mapping the stdout.

1 Answers
Related