Docker image ls missing TAGs

Hello,

maybe a simple question, but I didn’t found the answer yet.

When I run docker image ls command the column TAG is always <none> is there a reason why ?

root@server :~# docker image ls
REPOSITORY                                                      TAG       IMAGE ID       CREATED        SIZE
portainer/agent                                                 <none>    9f786420f676   36 hours ago   171MB
traefik                                                         <none>    4113453efcb3   7 days ago     226MB
rabbitmq                                                        <none>    d8584cd37af1   9 months ago   251MB

There is always a tag when you pull an image, but tags can disappear sometimes when another image needs the same version tag. For example when you run docker pull again and the same version tag points to a new image. I think, the repository name would disappear as well, but I admit I could tell you only after testing. Unfortunately I noted something strange while testing and I have the same image twice in thedocke rimage ls output, so somethingis happening with the image listing.

We usually need the following information to understand the issue:

  1. What platform are you using? Windows, Linux or macOS? Which version of the operating systems? In case of Linux, which distribution?

  2. How did you install Docker? Sharing the platform almost answers it, but only almost. Direct links to the followed guide can be useful.

  3. On debian based Linux, the following commands can give us some idea and recognize incorrectly installed Docker:

    docker info
    docker version
    

    Review the output before sharing and remove confidential data if any appears (public IP for example)

    dpkg -l 'docker*' | grep '^ii'
    snap list docker
    

    When you share the outputs, always format your posts according to the following guide: How to format your forum posts

I am mainly running this on debian 12, with docker-ce :

ii docker-ce 5:28.3.0-1~debian.12~bookworm amd64 Docker: the open-source application container engine

But I also face same behaviour with docker on my windows laptop.

After some testing, when I deploy let say traefik through a stack file the docker image ls output is :

traefik <none> 4113453efcb3 11 days ago 226MB

But when we run docker pull locally on the server the tag arrive :

root@server:~# docker pull traefik:latest
latest: Pulling from library/traefik
Digest: sha256:f3de2b96ec6b1cc987619c4d1d65d7e8140862eb0bbfc5f0e2e563691e8787d8
Status: Downloaded newer image for traefik:latest

root@server:~# docker image ls
traefik                                                         latest         4113453efcb3   11 days ago    226MB

I assume this is not related to my environment, just don’t know why docker behave like this.

It depends on how you pull the image. I forgot about pulling images by digest instead of the version tag

Example from the docs:

docker pull ubuntu@sha256:2e863c44b718727c860746568e1d54afd13b2fa71b160f5cd9058fc436217b30```

If you do this, you will not see a version tag in the image list, because you haven’t used one for pulling it.

thank you.

I forgot to share the stack file. I.E :

version: "3.3"

services:
  traefik:
    environment:
      - TZ=Europe/Paris
    image: "traefik:latest"
    command: # Static traefik config
      - --entrypoints.web.address=:80
      - --entrypoints.websecure.address=:443
      - --providers.swarm=true
      - --api=true
      - --accesslog=true  
      - --providers.swarm.exposedbydefault=false
      - --entrypoints.metrics.address=:8090
      - --metrics.prometheus=true 
      - --metrics.prometheus.entryPoint=metrics
      - --metrics.prometheus.addrouterslabels=true
      - --metrics.prometheus.addServicesLabels=true
    ports:
      - "80:80"
      - "8090:8090"
      - "443:443"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
    deploy:
      labels:
        - "traefik.enable=true"
        #Traefik Router Setup
        - "traefik.http.routers.dashboard.rule=Host(`traefik.domain.com`) && (PathPrefix(`/api`) || PathPrefix(`/dashboard`))"
        - "traefik.http.routers.dashboard.service=api@internal"
        - "traefik.http.routers.dashboard.middlewares=auth"
        - "traefik.http.middlewares.auth.basicauth.users=admin:redacted"
        - "traefik.http.services.dummy-svc.loadbalancer.server.port=9999"
      restart_policy:
        condition: any

will result in :

>docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
traefik      <none>    91f33a9ff29b   4 days ago   226MB

I’m pulling by the tag.

1 Like

Thank you. That example helps a lot to try to reproduce the issue. In my case, I could not reproduce the missing version tag, but another strange thing happened this time. It loks like if I let Swarm pull the image, I see the latest tag, but I cannot use it when I want to delete the image. If I use the version tag as “traefik” or “traefik:latest”, the docker cli says it doesn’t exist. I could only delete the image by image ID. If I use “docker pull” directly, I can also delete the image.

I saw this in Docker Desktop on macOS, but when I try Docker CE in a Linux VM, I see the same <none>. So it is a Swarm behavior, but since I’m not using Swarm, I’m not sure if it is normal. What do you think @bluepuma77

So it seems that you see the right value in the TAG column and I should see the same. I will try to figure out which one is the bug, but I feel the tag should always be visible if we used the tag to pull the image even if it was in a compose file (swarm stack file).

update:

I just disabled the “containerd” image store in Docker Desktop and now I see the same <none> in the output.

update 2

I found out that what you see is normal.

1 Like

indeed this is explained very well. thank you for your help !