I am trying to follow the tutorial here: (doesn’t allow me to post link)
I was able to create a secret and start a service successfully
$ printf "This is a secret" | docker secret create my_secret_data -
yr3saf1wus8ovauhjvlfugrax
$ docker service create --name redis --secret my_secret_data redis:alpine
64p8lw9e19q286e4o3x9i1c6x
overall progress: 1 out of 1 tasks
1/1: running [==================================================>]
verify: Service converged
$ docker service ps redis
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
y9pd8u5dlui6 redis.1 redis:alpine ord Running Running 17 seconds ago
But when I try to get the container ID using the command in that article, I get nothing
$ docker ps --filter name=redis -q
I also tried
$ docker ps --filter name=redis.1 -q
with same result. How can I get container ID of a service? I am running Docker on Linux
$ docker -v
Docker version 18.06.1-ce, build e68fc7a
The reason above didn’t work was that the container was deployed on the ord node. This can be seen in output of docker service ps redis. When we checked on ord we were able to find the container.