> docker run -d --name redis crosbymichael/redis
これが何やるコンテナなのか、当然redis-server
かなんかを実行するんだと思いますが、Dockerfileの中身的なのを見たいなぁと思いました。ちなみにrun -d
はdetachです。関係無いですがdocker -d
はデーモンモードです。
> docker inspect crosbymichael/redis
[{
"id": "f36b976fc0d2b2754ebc18d10c96e820e571034b7e919bb56b2e3f3680ace856",
"parent": "8279b4456b9660e2c121feacb25587cffe6c519e1336fd73b4ffe3bcb54300ea",
"created": "2014-05-07T00:55:37.942624858Z",
"container": "6d339f3ddeb8b1186ed7ce1c5f1a3e09796691337de030185609cac02b27c610",
"container_config": {
"Hostname": "baa8e009e3ac",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"6379/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) CMD [--bind 0.0.0.0 --save 900 1 --save 300 10 --save 60 10000]"
],
"Image": "8279b4456b9660e2c121feacb25587cffe6c519e1336fd73b4ffe3bcb54300ea",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": [
"redis-server"
],
"NetworkDisabled": false,
"OnBuild": []
},
"docker_version": "0.10.0",
"config": {
"Hostname": "baa8e009e3ac",
"Domainname": "",
"User": "",
"Memory": 0,
"MemorySwap": 0,
"CpuShares": 0,
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"6379/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"HOME=/",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"--bind",
"0.0.0.0",
"--save",
"900",
"1",
"--save",
"300",
"10",
"--save",
"60",
"10000"
],
"Image": "8279b4456b9660e2c121feacb25587cffe6c519e1336fd73b4ffe3bcb54300ea",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": [
"redis-server"
],
"NetworkDisabled": false,
"OnBuild": []
},
"architecture": "amd64",
"os": "linux",
"Size": 0
}]
Entrypointにredis-server
が設定されてます。やったね (参考: http://docs.docker.io/reference/builder/#entrypoint)