Docker - Inspect service using the docker service inspect command

by
Jeremy Canfield |
Updated: November 05 2021
| Docker articles
Before inspecting a service, the docker service ls command to list the services. Let's say you want to inspect the foo-service.
~]# docker service ls
ID NAME MODE REPLICAS IMAGE PORTS
jwwpwkpzkqe0 foo-service repliacted 1/1 server1.example.com/foo:latest *:8101->8080/tcp
rof5uwjm749q bar-service repliacted 1/1 server1.example.com/bar:latest *:8155->8104/tcp
v771iegeoxrm service003 repliacted 1/1 server1.example.com/helloworld:latest *:8123->8000/tcp
The docker service inspect command can be used to display the details of the service.
~]# docker service inspect foo-service
[
{
"ID": "rycaethva3f2g95xw5o4ederl",
"Version": {
"Index": 407593672
},
"CreatedAt": "2019-09-25T22:12:56.073228901Z",
"UpdatedAt": "2021-11-05T09:11:14.334379763Z",
"Spec": {
"Name": "foo-service",
"Labels": {
"com.docker.stack.image": "registry.example.com/foo/foo:latest",
"com.docker.stack.namespace": "foo",
Did you find this article helpful?
If so, consider buying me a coffee over at