title: Docker : Echo to Terminal used to run Docker Image
body: <p>Is there a way for echo's to show up in the terminal where the docker run command is issued. It appears echo's only show here if the -d option isn't used. I can do docker logs to see these echos but I wanted to know if there was a way for them to show directly in the terminal issuing the run command?</p>
  
  <p>Dockerfile:</p>
  
  <pre><code># Generic Docker Image for Running Node app from Git Repository
  FROM    node:0.10.33-slim
  ENV NODE_ENV production
  
  # Add script to pull Node app from Git and run the app
  COPY docker-node-entrypoint.sh /entrypoint.sh
  RUN chmod +x /entrypoint.sh
  ENTRYPOINT ["/entrypoint.sh"]
  
  EXPOSE  8080
  CMD ["--help"]
  </code></pre>
  
  <p>Entrypoint script:</p>
  
  <pre><code>#!/bin/bash
  set -e
  # Run the command passed in if it isn't to start a node app
  if [ "$1" != 'node-server' ]; then
     exec "$@"
  fi
  # Logic for pulling the node app and starting it
  cd /usr/src
  # try to remove the repo if it already exists
  rm -rf node-app; true
  echo "Pulling Node app's source from $2"
  git clone $2 node-app
  cd node-app
  # Check if we should be running a specific commit from the git repo
  if [ ! -z "$3" ]; then
    echo "Changing to commit $3"
    git checkout $3
  fi
  npm install
  echo "Starting the app"
  exec node .
  </code></pre>