0
   docker stop lastContainerName

It works fine. I want to stop it using docker ps -l command

   docker stop | docker ps -l

I tried this. Unfortunately docker stop --help getting executed.

Am i missing something? How to achieve this? Any Suggestions.

Gibbs
  • 21,904
  • 13
  • 74
  • 138
  • Are you using Boot2Docker on Mac or on Windows? They have different command-line syntax. – Bryan Dec 24 '14 at 11:29

1 Answers1

1

It looks like what you are trying to do is to pipe the output of docker ps -l as an argument of the docker stop command. One way to do this in Unix is with back-quotes:

docker stop `docker ps -lq`

(I also added a -q option so you get just the ID with no column-names, etc.)

Bryan
  • 11,398
  • 3
  • 53
  • 78