I’m following some of the Getting Started guides and the following one does not work for me:
Everything is fine until you pipe the echo output to netcat, then the container exits but there is nothing in the logs at the end. I tested it by doing a bash session:
docker run -i -t -p 4444 ubuntu /bin/bash
And then doing a
nc -kl 4444
And in the host, sending text to the forwarded port and I’m seeing that the container is outputting the messages, but if I just do as the example has:
JOB=$(docker run -d -p 4444 ubuntu:12.10 /bin/nc -l 4444)
Then the message is never (seemingly) put on stdout and into the docker logs before the container exits.
Any ideas as to why I’m seeing this behavior?
I’m running docker 1.9 in Ubuntu Trusty.
docker run -d -p 4444 ubuntu /bin/bash -c "/bin/nc -l 4444; echo hey"
I ran this and the ‘hey’ is always output in the docker logs, but netcat does not output the text that I sent to it on the forwarded port (to 4444) to the docker logs.