How do I check docker startup options

Asked 2 years ago, Updated 2 years ago, 53 views

Docker version 1.10.3, build cb079f6-unsupported
is used.On CentOS 7.

I forgot what option to start when creating docker container.
You can check the port forwarding in docker ps, but can you find out what you have given, such as restart, e, privileged, etc. from the moving docker container?

Please let me know if you know.

docker

2022-09-30 21:29

1 Answers

Could you get the necessary information from docker inspect?
The information is printed in json format, so you can combine it with the jq command.

For example, you can check restart in a container named test:

$docker inspect test | jq'.[0].HostConfig.RestartPolicy'
{
  "Name": "always",
  "MaximumRetryCount": 0
}

Additional information can be found as follows:

$docker inspect test | jq'.[0].Config.Env'
[
  "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
  "TEST=aaa"
]
$ docker inspect test | jq'.[0].HostConfig.Privileged'
false
$


2022-09-30 21:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.