TME
TME

Reputation: 129

What does 'docker images ls' do?

I looked up the docs to understand the difference between commands docker image (managing images) and docker images (list images). So the second option seems to be a shortcut for docker image ls which also lists images.

What I noticed is, when running docker image ls or docker images I get a list of all my images as expected, but when I accidentally mixed those two up and run docker images ls I get an empty table without any entries:

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

I would expect it either to be an invalid command since it is redundant or to show the same list of all my images.

So what does docker images ls actually show?

Upvotes: 7

Views: 996

Answers (2)

Mike Doe
Mike Doe

Reputation: 17604

Long story short: the list is empty because you have no images named ls.

You can read about it in the docs.

Upvotes: 2

Shinva
Shinva

Reputation: 2302

  • docker image ls lists the images
  • docker images also lists the images
  • docker images ls lists the images with the repository name ls. And as you dont have any images named ls it is returning an empty list.

Reference : https://docs.docker.com/engine/reference/commandline/images/

Upvotes: 7

Related Questions