0

I have install docker using following command:

 sudo apt-get install docker.io

for testing purpose, I run a Ubuntu image in detached mode using

sudo docker run -d -it Ubuntu

But when I tried to execute docker ps command like

sudo docker ps --format

I got some error. According to the error, the flag --format is not defined. Following is the error message.

flag provided but not defined: --format
See 'docker ps --help'.

When I check for the help page I found this

Usage: docker ps [OPTIONS]
List containers    
-a, --all=false       Show all containers (default shows just running)
--before=             Show only container created before Id or Name  
-f, --filter=[]       Filter output based on conditions provided
--help=false          Print usage
-l, --latest=false    Show the latest created container, include non-running
-n=-1                 Show n last created containers, include non-running
--no-trunc=false      Don't truncate output
-q, --quiet=false     Only display numeric IDs
-s, --size=false      Display total file sizes
--since=              Show created since Id or Name, include non-running

According to help page, there is no flag --format is defined. But according to the reference in https://docs.docker.com/engine/reference/commandline/ps/ , I should be able to run the command with --format flag.

What could be the reason ?

Supplementary Information

  • OS: Ubuntu 14.04
  • docker version : Docker version 1.6.2, build 7c8fca2

-Thank you

1 Answers1

1

The --format option was only added to docker ps in version 1.8.0 so unless you are able to upgrade then you won't be able to use it.

It would be quite handy if this was made clear in the documentation page you linked to but I think probably docker just expect you to use the latest version - they are not known for providing long term support for older versions.

joelnb
  • 1,426
  • 11
  • 14