3

I am trying to get a shell inside the Docker container moul/phoronix-test-suite on Docker Hub using this command

docker run -t -i moul/phoronix-test-suite /bin/bash

but just after executing the command (binary file), the container stops and I get no shell into it.

[slazer@localhost ~]$ docker ps -a
CONTAINER ID        IMAGE                      COMMAND                  CREATED             STATUS                     PORTS               NAMES
0993189463e6        moul/phoronix-test-suite   "phoronix-test-suite "   7 seconds ago       Exited (0) 3 seconds ago                       kickass_shockley

It is a ubuntu:trusty container. How can I get a shell into it, so that I can send arguments to the command phoronix-test-suite?

Slazer
  • 4,750
  • 7
  • 33
  • 60

2 Answers2

5

docker run -t -i moul/phoronix-test-suite /bin/bash will not give you a bash (contrary to docker run -it fedora bash)

According to its Dockerfile, what it will do is execute

phoronix-test-suite /bin/bash

Meaning, it will pass /bin/bash as parameter to phoronix-test-suite, which will exit immediately. That leaves you no time to execute a docker exec -it <container> bash in order to open a bash in an active container session.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Fabulous, thank you. So I have been using it the wrong way, correctly I should type something like `docker run -it moul/phoronix-test-suite detailed-system-info`. – Slazer May 07 '16 at 22:41
-1

Have you tried restarting your docker? It might need to restart or even reboot the host.

  • I have stopped and removed all containers, the `docker ps -a` and `sudo docker ps -a` now does not show anything. I have even rebooted the machine multiple times. It did not help. – Slazer May 07 '16 at 21:23
  • Follow the link mentioned above and if those steps do not work come back for more brain storming. I will start my docker here and try the commands you are using to figure out where the solution can be found – Stanley Nyadzayo May 07 '16 at 21:28
  • Seems like the container is not running, even the status is `Exited (0)`. If you want to brainstorm with me, you better join #docker on irc.freenode.net. I am there. – Slazer May 07 '16 at 21:37