Create new container with interactive shell

I wanted to create a new container with Node.js and start a bash-shell in it where I can interactively verify something.

Therefore I did docker run node /bin/bash but it exited instantly.
What did I do wrong?

  • Port forwarding: docker -> vagrant -> host
  • grunt-cli doesn't work with docker volume mounted, fine without
  • How to change docker default ip binding?
  • remove dlite from Mac
  • Docker and Analytics Install
  • Kubernetes Kube-Proxy Server: Can it run without iptables' nat module?
  • YARN DCE can not running
  • How to properly setup a data volume container?
  • “Can't connect to local MySQL server” in docker-compose
  • Docker not finding php's mysql extension
  • internal infrastructure with docker
  • How to do a none interactive pecl install stomp
  • One Solution collect form web for “Create new container with interactive shell”

    You missed the -it: docker run -it <image-name> /bin/bash

    –interactive, -i: Keep STDIN open even if not attached

    –tty, -t: Allocate a pseudo-TTY

    docker run reference

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.