Yes, you can use docker inspect
one that has a format json
, and you just need to request it.
Here is the relevant docker checkout output for a running container zen_easley
. Note to change the container name as appropriate for your environment.
docker inspect zen_easley
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": true,
You can simply run the following command to get the same output.
$ docker inspect -f "{{ .HostConfig.RestartPolicy }}" zen_easley
{no 0}
, RestartPolicy
Name, MaximumRetryCount
, 0 - ,
, Name
, , .Name
:
docker inspect -f "{{ .HostConfig.RestartPolicy.Name }}" zen_easley
no