Skip to content

docker images --filter=reference giving seemingly unpredictable results #1332

Description

@pcolmer

Description

Having read #625, I've tried using docker images --filter=reference= with various permutations of repository name, tag and wildcards … and the results seem to be a bit unpredictable. I'm not sure if it is me, the documentation or the software.

Steps to reproduce the issue:

  1. Run docker images first of all to get a list of all of the images on the system.
  2. Try docker images --filter reference="*:latest" as suggested by issue 625.
  3. Try docker images --filter reference='linaroits*:CON*' as a wildcard filter.
  4. Try docker images --filter reference='*:*18*' as a wildcard filter.
  5. Try docker images --filter reference='*:*18' as a wildcard filter.
  6. Try docker images --filter reference='*:CON*' as a wildcard filter.
  7. Try docker images --filter reference='*:*CON*' as a wildcard filter.

Describe the results you received:

$ docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
linaroits/jekyllsitebuild   CON-JBC-JOB1-22     44360d759a69        4 days ago          633 MB
linaroits/jekyllsitebuild   latest              44360d759a69        4 days ago          633 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-21     e01c7c71e91b        4 days ago          633 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-19     2b0eca716029        2 weeks ago         633 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-20     2b0eca716029        2 weeks ago         633 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-18     7d8401025378        3 weeks ago         632 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-17     9ea9abcb0b95        3 weeks ago         632 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-16     1e6a32a8b36d        3 weeks ago         632 MB
linaroits/jekyllsitebuild   CON-JBC-JOB1-15     42602caf4124        3 weeks ago         632 MB
linaroits/odpdocsbuild      latest              9264947a316c        3 weeks ago         1.14 GB
$ docker images --filter=reference="*:latest"
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
$ docker images --filter=reference='linaroits*:CON*'
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
$ docker images --filter=reference="*:*18*"
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              18.04               735f80812f90        5 weeks ago         83.5 MB
$ docker images --filter=reference="*:*18"
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
$ docker images --filter=reference="*:CON*"
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
$ docker images --filter=reference="*:*CON*"
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

Describe the results you expected:

  1. I would have expected the two images with a tag of latest to be listed.

  2. I would have expected the 8 images with a repository starting linaroits and a tag starting CON to be listed.

  3. I would have expected linaroits/jekyllsitebuild:CON-JBC-JOB1-18 to be included in the output.

  4. I would have expected linaroits/jekyllsitebuild:CON-JBC-JOB1-18 to be included in the output.

  5. I would have expected all images with a tag starting CON to be listed.

  6. I would have expected all images with CON somewhere in the tag to be listed which, in my case, would be the same output as test 6 would have produced.

Output of docker version:

Client:
 Version:      17.03.2-ce
 API version:  1.27
 Go version:   go1.6.2
 Git commit:   f5ec1e2
 Built:        Thu Jul  5 23:07:48 2018
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.2-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.6.2
 Git commit:   f5ec1e2
 Built:        Thu Jul  5 23:07:48 2018
 OS/Arch:      linux/amd64
 Experimental: false

Output of docker info:

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 72
Server Version: 17.03.2-ce
Storage Driver: aufs
 Root Dir: /srv/docker/aufs
 Backing Filesystem: extfs
 Dirs: 60
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 4ab9917febca54791c5f071a9d1f404867857fcc
runc version: 54296cf40ad8143b62dbcaa1d90e520a2136ddfe
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.4.0-1063-aws
Operating System: Ubuntu 16.04.5 LTS
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 7.795 GiB
Name: ip-10-0-0-18
ID: 54YX:6QXI:5QDF:P5FV:M5JS:Y75Z:VNUD:SVEI:MO7N:UVFL:5RRM:G3LZ
Docker Root Dir: /srv/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):
Docker is running on Ubuntu 16.04 AWS EC2 instance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions