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?

  • Build docker image from local instead of git clone
  • docker neo4j cannot connect to load csv from remote url
  • Installing a .exe on a windows container
  • Multiple Docker images filesystem scan
  • How to pass ARG value to ENTRYPOINT?
  • docker revert changes to container
  • Pull docker image from AWS ECR using remote API
  • docker pull generate 403 error message on latest version
  • What is the simplest way to install Redis in Docker+Vagrant
  • How do I expose a docker container port to another container
  • NodeJS: Can't connect to postgreSQL container from another container
  • Running mysql in the foreground in centos
  • 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.