0

I have installed docker toolbox for windows and run hello-world.

I now want to stop it with

docker stop hello-world

But this generate an error :

failed to stop container (hello-world) no such container

When I do docker images hello-world is there

user310291
  • 35,095
  • 76
  • 252
  • 458

1 Answers1

3

When I do docker images hello-world is there

But when you do a docker ps -a, do you see a container hello-workd running? (or at all?)

docker stop stops a running container, not an image.

hello-world is an image which, when executed as a container, prints hello-world and immediately exit. There is nothing to stop at this point.

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
  • I can see hello-world with docker ps -a but status is exited. I have another one jenkins which is up I cannot stop either. How do I stop that one it seems to have a container name only an id ? – user310291 Mar 28 '16 at 13:46
  • @user310291 For the one existed, I would advice a `drmae` (an alias that I use to remove all exited containers: http://stackoverflow.com/a/32723127/6309: it is short for "docker remove all exited containers") – VonC Mar 28 '16 at 13:49
  • "How do I stop that one it seems to have a container name only an id?" You can use its id to stop it (or stop and remove with `docker rm -f`) – VonC Mar 28 '16 at 13:50