1

I'm deploying a cluster using Docker Swarm with the following docker-compose.yml:

version: "3.8"
services:
  # Other services...

  # Workers
  worker:
    image: "jwaresolutions/big-data-cluster:0.4.3-survival"
    # Other settings...
    deploy:
      placement:
        constraints:
          - node.labels.role==worker
        # One replica per node
        max_replicas_per_node: 1
      # Deploy N containers for this service
      replicas: 3
    hostname: "{{.Node.Hostname}}"

volumes:
  # ...

networks:
  # ...

When I run the command docker container ls in all the replicas, It's showing the correct image jwaresolutions/big-data-cluster:0.4.3-survival:

CONTAINER ID        IMAGE                                            COMMAND                  CREATED             STATUS              PORTS               NAMES
1efffa6027a5        jwaresolutions/big-data-cluster:0.4.3-survival   "bash -c '/home/big_…"   17 hours ago        Up 17 hours                             big-data-docker_worker.1.0l4ggu4mne9m040nih7jy9x4s

But then I run the command docker image ls it's listing the following images:

REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
jwaresolutions/big-data-cluster   <none>              caceaacc4909        5 weeks ago         4.65GB
jwaresolutions/big-data-cluster   <none>              ebee0452faeb        6 weeks ago         4.65GB
jwaresolutions/big-data-cluster   <none>              0aa947baa686        8 months ago        4.63GB
jwaresolutions/big-data-cluster   <none>              458e5ceb82b9        8 months ago        4.51GB
jwaresolutions/big-data-cluster   <none>              4a01dd36775f        10 months ago       4.49GB
jwaresolutions/big-data-cluster   0.4                 3407e263e81e        11 months ago       4.49GB
jwaresolutions/big-data-cluster   0.3-survival        25e167ef146e        15 months ago       3.86GB
jwaresolutions/big-data-cluster   <none>              bbc920dfb2dd        22 months ago       3.67GB
jwaresolutions/big-data-cluster   <none>              09f57a9dde60        2 years ago         3.67GB
jwaresolutions/big-data-cluster   <none>              c147ee54ee82        2 years ago         3.12GB

Why is not listed the image with tag :0.4.3-survival? Is there a way to inspect the image object being used by the container (specifically, I wanted to get the digest field as mentioned in this answer)?

Genarito
  • 3,027
  • 5
  • 27
  • 53

1 Answers1

0

So to answer your last question
docker ps -a
Lists CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
In its output. Looking around it seems like if a tag is specified when the container is built, it should be included in the IMAGE output of the container.

Mostly referring to this answer as it seems like others have some scripts that may be helpful as well

How to find all image tags of a running Docker container?

therealdakotal
  • 244
  • 1
  • 11
  • Hi, first of all, thank you for your reply! The problem is that I want to inspect the image, not to know which image is being used by the container (that information I already get with the `docker container ls` command). Specifically, I wanted to get the `digest` field as mentioned in [this answer](https://stackoverflow.com/a/33511811/7058363), but since it doesn't exist as a docker image on my machine, I can't inspect it. I already edited the question to avoid confusion :D – Genarito Mar 10 '23 at 21:48