Related
I stopped my docker container.
and i restart the service in linux (service docker restart)
after that my container is missing.
I typed docker ps -a but I can't find my splunk container.
I can find container directory and volume folder also.
also I have every folder in inspection result.
but I can't see when I type docker ps -a
how can I restore it ?
this is my docker inspect result, when container is exist.
[
{
"Id": "9e12bb7b2f8a926c0b7852aa9f1bf957363f327d6de53778059bf0fc05711039",
"Created": "2018-10-02T04:05:28.013507313Z",
"Path": "/sbin/entrypoint.sh",
"Args": [
"start-service"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 11513,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-09-22T05:22:09.939497539Z",
"FinishedAt": "2020-09-22T05:20:05.99542747Z"
},
"Image": "sha256:507021d7e77f9bdd337aeb47729a806162579f36e5d73b14f2a508e545adae72",
"ResolvConfPath": "/storage/docker/containers/9e12bb7b2f8a926c0b7852aa9f1bf957363f327d6de53778059bf0fc05711039/resolv.conf",
"HostnamePath": "/storage/docker/containers/9e12bb7b2f8a926c0b7852aa9f1bf957363f327d6de53778059bf0fc05711039/hostname",
"HostsPath": "/storage/docker/containers/9e12bb7b2f8a926c0b7852aa9f1bf957363f327d6de53778059bf0fc05711039/hosts",
"LogPath": "/storage/docker/containers/9e12bb7b2f8a926c0b7852aa9f1bf957363f327d6de53778059bf0fc05711039/9e12bb7b2f8a926c0b7852aa9f1bf957363f327d6de53778059bf0fc05711039-json.log",
"Name": "/splunk",
"RestartCount": 0,
"Driver": "overlay",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"8000/tcp": [
{
"HostIp": "",
"HostPort": "8000"
}
],
"8089/tcp": [
{
"HostIp": "",
"HostPort": "8089"
}
]
},
"RestartPolicy": {
"Name": "unless-stopped",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DeviceCgroupRules": null,
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/storage/docker/overlay/25444b7c23c5d0bf0a6d4d1563a587831b7c329e6623ee720e609a0a16787ef5/root",
"MergedDir": "/storage/docker/overlay/53d6023089444b76af280ef1220a2851c1b5045167c471f5f60f9faa0389ccd3/merged",
"UpperDir": "/storage/docker/overlay/53d6023089444b76af280ef1220a2851c1b5045167c471f5f60f9faa0389ccd3/upper",
"WorkDir": "/storage/docker/overlay/53d6023089444b76af280ef1220a2851c1b5045167c471f5f60f9faa0389ccd3/work"
},
"Name": "overlay"
},
"Mounts": [
{
"Type": "volume",
"Name": "cb9d0886db87a17304310bfa5a242972bf9c76464eb0c85c24902c7764443714",
"Source": "/storage/docker/volumes/cb9d0886db87a17304310bfa5a242972bf9c76464eb0c85c24902c7764443714/_data",
"Destination": "/opt/splunk/etc",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
},
{
"Type": "volume",
"Name": "5d637a70101b4d6a80261abfeac9534b8b77bde4669c6225dedf3a9bcfb4434a",
"Source": "/storage/docker/volumes/5d637a70101b4d6a80261abfeac9534b8b77bde4669c6225dedf3a9bcfb4434a/_data",
"Destination": "/opt/splunk/var",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "9e12bb7b2f8a",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"1514/tcp": {},
"8000/tcp": {},
"8088/tcp": {},
"8089/tcp": {},
"8191/tcp": {},
"9997/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"SPLUNK_START_ARGS=--accept-license",
"SPLUNK_USER=root",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"SPLUNK_PRODUCT=splunk",
"SPLUNK_VERSION=7.0.0",
"SPLUNK_BUILD=c8a78efdd40f",
"SPLUNK_FILENAME=splunk-7.0.0-c8a78efdd40f-Linux-x86_64.tgz",
"SPLUNK_HOME=/opt/splunk",
"SPLUNK_APPS=/opt/splunk/etc/apps",
"SPLUNK_GROUP=splunk",
"SPLUNK_BACKUP_DEFAULT_ETC=/var/opt/splunk",
"LANG=en_US.utf8",
"JAVA_HOME=/opt/jdk/jdk1.8.0_152/"
],
"Cmd": [
"start-service"
],
"ArgsEscaped": true,
"Image": "klustree/splunk:7.0.0",
"Volumes": {
"/opt/splunk/etc": {},
"/opt/splunk/var": {}
},
"WorkingDir": "/opt/splunk",
"Entrypoint": [
"/sbin/entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "57cf9a7d9ec5d31e685fd5ea9232a3126fab1a90406449cc4d48b43a2f7c4f57",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"1514/tcp": null,
"8000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8000"
}
],
"8088/tcp": null,
"8089/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8089"
}
],
"8191/tcp": null,
"9997/tcp": null
},
"SandboxKey": "/var/run/docker/netns/57cf9a7d9ec5",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "b4d39d4b6615127cd6aaeda1e0e14e73d910fadf9b596d5b81698d3fc1c53945",
"Gateway": "172.17.1.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.1.4",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:01:04",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "c563f5e5d0e2e4bd6d35f5802395f77874679e40a522dabaee59b93d3747619c",
"EndpointID": "b4d39d4b6615127cd6aaeda1e0e14e73d910fadf9b596d5b81698d3fc1c53945",
"Gateway": "172.17.1.1",
"IPAddress": "172.17.1.4",
"IPPrefixLen": 24,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:01:04",
"DriverOpts": null
}
}
}
}
]
please help...
This is the default behavior of the docker service, in the docs we learn:
By default, when the Docker daemon terminates, it shuts down running containers. Starting with Docker Engine 1.12, you can configure the daemon so that containers remain running if the daemon becomes unavailable. This functionality is called live restore. The live restore option helps reduce container downtime due to daemon crashes, planned outages, or upgrades.
Here you can learn how to keep your containers alive when occurring a service timeout.
And here you can configure for your containers still alive when the docker service is restarted.
Although live-restore and the restart policy might seem similar they have different purposes:
Restart policies are different from the --live-restore flag of the dockerd command. Using --live-restore allows you to keep your containers running during a Docker upgrade, though networking and user input are interrupted.
With docker container inspect xxx, I can find the mount information.
"Mounts": [
{
"Type": "bind",
"Source": "/deploy/app/log",
"Destination": "/home/applog",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
After docker exec -it xxx bash, the /deploy/app/log directory is there and the file in it is also updated.
However, the /home/applog directory is not created on the host and I double checked the source it's right eg. deploy/app/log
This question is quite close to my situation, since the answer talking about mount with directory would solve that, means not my problem.
Files within Docker bind mount directory not updating
My assumption is about writing privilege.Any idea on how to troubleshooting on this situation?
UPDATE:
See full command of running/stopped container in Docker
Find COMMAND is "/usr/bin/supervisord"
UPDATE:
The server is using CentOS.
[
{
"Id": "9b7127d72e8cdf42b7bf7ec1e6559d2d9c02eb0deb197375c084532a8e4f443c",
"Created": "2018-11-15T09:22:42.498258742Z",
"Path": "/usr/bin/supervisord",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 19508,
"ExitCode": 0,
"Error": "",
"StartedAt": "2019-02-19T08:17:25.738865995Z",
"FinishedAt": "2019-02-19T08:17:25.484443245Z"
},
"Image": "sha256:02079d9230e89eeb1eb14d61ab299da9e0301abed90864655087a39c3010a222",
"ResolvConfPath": "/var/lib/docker/containers/9b7127d72e8cdf42b7bf7ec1e6559d2d9c02eb0deb197375c084532a8e4f443c/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/9b7127d72e8cdf42b7bf7ec1e6559d2d9c02eb0deb197375c084532a8e4f443c/hostname",
"HostsPath": "/var/lib/docker/containers/9b7127d72e8cdf42b7bf7ec1e6559d2d9c02eb0deb197375c084532a8e4f443c/hosts",
"LogPath": "",
"Name": "/prime",
"RestartCount": 0,
"Driver": "overlay2",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/deploy/app/log/:/home/primelog/"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "journald",
"Config": {}
},
"NetworkMode": "isolated_nw",
"PortBindings": {
"5000/tcp": [
{
"HostIp": "",
"HostPort": "5000"
}
],
"80/tcp": [
{
"HostIp": "",
"HostPort": "90"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "docker-runc",
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpuRealtimePeriod": 0,
"CpuRealtimeRuntime": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"DiskQuota": 0,
"KernelMemory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Name": "overlay2",
"Data": {
"LowerDir": "/var/lib/docker/overlay2/705a362229df9caa92a7df72427890ea99ab01f04fc0d3056e55d50f69fe0214-init/diff:/var/lib/docker/overlay2/83e113da8135ee896fa64413cfbc5198c6414d556e002e5f5d398e3615683a0f/diff:/var/lib/docker/overlay2/334a1f552eb25e0fec63bf12e2c3a0cbf168b3ddee22c9349d935557b3ec1e40/diff:/var/lib/docker/overlay2/6745c1ba399830b8f2b8c4bcce5704093dab7342bb97e57ad6c7de666c2a7923/diff:/var/lib/docker/overlay2/a4721324b462df2f6197206ebd61c803f75ea1ea8d9a3a15d6876a4439c359c0/diff:/var/lib/docker/overlay2/4ab1ee75afa757ccba6d744c0b773e75e8d0d064f367496cc1dc9c140800303a/diff:/var/lib/docker/overlay2/ae19ae7d9c4878438bfe3d80c8a7be32304df2e9af95f851f1d5fa9636c555f5/diff:/var/lib/docker/overlay2/c01c124469518c189dd1384f81e7d887fa5ee5cd46c368b67fa75285fad61a7a/diff:/var/lib/docker/overlay2/3bdec856fe714fb865d6bdb3e2d2b5512aac8c5eed8c20c00416a92159b0469b/diff:/var/lib/docker/overlay2/ae4bdc4a37252da3326f81ed8536f4c536aa59d6b46a1e198893c0aa816a3bda/diff:/var/lib/docker/overlay2/ecab217632d4c34bbafb098755855d0f5861fd21a4df809f1c16081a08a33865/diff:/var/lib/docker/overlay2/c5958ffc7e373cf927b181010d3d40b2bac384f7d45253842dc7316022f4c8ff/diff:/var/lib/docker/overlay2/bd73e0cc649d72fcb1eaabf582ba948b34d5e91f43d1ce1a9dd54192beecde26/diff:/var/lib/docker/overlay2/3cfccc6f5782f0e83be600097aa6d9f0da0d2bd978ffd4f36c97060fad7352c8/diff:/var/lib/docker/overlay2/a0efa6e2c8dfa6529c1ce891406e5c3be1559809d05d0efafd789453615c2e50/diff:/var/lib/docker/overlay2/87959f4181e90b251956cf864095821dce34b8e4f925713c2de1e029e11c5b6b/diff:/var/lib/docker/overlay2/2fae884b115fe56f6e04de3df4391501d0bb694f2ec3b8c4189c5519642231e1/diff:/var/lib/docker/overlay2/ec08c775e3bf6968bb67bf7713313f7d9bad5c29dc49baddb623d5bc0c5218f6/diff:/var/lib/docker/overlay2/d37caccf87df38f4ffee6fcd9b96c81fd323d52e3a1eeb85d75babf9f0b59ac6/diff:/var/lib/docker/overlay2/6f7c20c7f13cc18c86de6f7c8f574a2a123b06e0e1f65a18eca7981e601ed819/diff:/var/lib/docker/overlay2/2055cc3e03990255615e9843b9e5df2e5a9d5fd44b65bc83fc867611bd67a538/diff:/var/lib/docker/overlay2/913548c1650469d344bbe8eb41a824669b6665c2aa8c2ac08ded95324314597f/diff:/var/lib/docker/overlay2/6b3eae5e3b2adba7114d823d2321b272c59f5ae58408ce1e88c97eb98614873e/diff:/var/lib/docker/overlay2/b466e47668a96fdb8c1a622c30a827c9c0073448ddcfbe57fb3d2be5fa8881c4/diff:/var/lib/docker/overlay2/ffef761f24efe242c032951ef1bf10134bb1a541bd66b04d3f3c934d03c14b32/diff",
"MergedDir": "/var/lib/docker/overlay2/705a362229df9caa92a7df72427890ea99ab01f04fc0d3056e55d50f69fe0214/merged",
"UpperDir": "/var/lib/docker/overlay2/705a362229df9caa92a7df72427890ea99ab01f04fc0d3056e55d50f69fe0214/diff",
"WorkDir": "/var/lib/docker/overlay2/705a362229df9caa92a7df72427890ea99ab01f04fc0d3056e55d50f69fe0214/work"
}
},
"Mounts": [
{
"Type": "bind",
"Source": "/deploy/app/log",
"Destination": "/home/primelog",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "9b7127d72e8c",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"5000/tcp": {},
"80/tcp": {}
},
"Tty": true,
"OpenStdin": true,
"StdinOnce": false,
"Env": [
"DEMS_ENV=product",
"PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"GPG_KEY=0D96DF4D4110E5C43FBFB17F2D347EA6AA65421D",
"PYTHON_VERSION=3.7.0",
"PYTHON_PIP_VERSION=18.0",
"PYTHONIOENCODING=utf-8"
],
"Cmd": [
"/usr/bin/supervisord"
],
"ArgsEscaped": true,
"Image": "primetmr",
"Volumes": null,
"WorkingDir": "/deploy/app",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"author": "wrui",
"purpose": "= "
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "2a9cfc3d58b56ede602075d4e39f3d7fb3597b0db4bf8ea1f0c5dccd625d8972",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"5000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "5000"
}
],
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "90"
}
]
},
"SandboxKey": "/var/run/docker/netns/2a9cfc3d58b5",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"isolated_nw": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"9b7127d72e8c"
],
"NetworkID": "2b169058c11e359b8add8d7cd7949936039dae21f6b0a0dbf26e6ed83df8422b",
"EndpointID": "fe83ca9952dadc80278adba7f96095be542a565139ba24ff6f63cdf486d62775",
"Gateway": "172.25.0.1",
"IPAddress": "172.25.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:19:00:03"
}
}
}
}
]
Find on official site https://docs.docker.com/storage/bind-mounts/
The source of the mount. For bind mounts, this is the path to the file
or directory on the Docker daemon host. May be specified as source or
src.
The destination takes as its value the path where the file or
directory is mounted in the container. May be specified as
destination, dst, or target.
They are wrong ordered in the docker run command.
I am having two docker containers in IBM Bluemix. One is MQTT and other php-python.
The PHP application executes a python script that should connect to the MQTT docker container and subscribe to a topic.
However, the php-python docker fails to connect. It also fails to ping to the MQTT docker container.
The MQTT container is working perfect as I am able to connect to it from my local machine.
I have tried linking the two containers using the following command:
cf ic run -p 443 -p 80 --name connector --link moscacontainer:source
registry.ng.bluemix.net/fortspace/php-mqtt
I have exposed the ports 1883 and 80 for the MQTT container.
I have used the following link as reference:
https://github.com/dceejay/nrdock/blob/master/README.md#linking-containers
Can someone guide on this?
EDIT: The output for cf ic inspect
[
{
"BluemixApp": null,
"BluemixServices": null,
"Config": {
"AttachStderr": false,
"AttachStdin": false,
"AttachStdout": false,
"Cmd": [],
"Dns": "",
"Env": [
"logging_password=",
"space_id=f874124c-cea6-460e-9bf2-b633eeeefcdf",
"logstash_target=logmet.opvis.bluemix.net:9091",
"metrics_target=logmet.opvis.bluemix.net:9095"
],
"Hostname": "instance-0018c601",
"Image": "registry.ng.bluemix.net/fortspace/php-mqtt:latest",
"ImageArchitecture": "amd64",
"Labels": {},
"Memory": 256,
"MemorySwap": "",
"OpenStdin": true,
"PortSpecs": "",
"StdinOnce": false,
"Tty": true,
"User": "",
"VCPU": 1,
"VolumesFrom": "",
"WorkingDir": ""
},
"ContainerState": "Running",
"Created": "2017-01-11T06:21:38.000000000Z",
"Group": {},
"HostConfig": {
"Binds": [],
"CapAdd": [],
"CapDrop": [],
"ContainerIDFile": "",
"Links": [
"moscacontainer:source"
],
"LogConfig": {
"Config": {},
"Type": "json-file"
},
"LxcConf": [],
"PortBindings": {
"443/tcp": [
{
"HostPort": "443"
}
],
"80/tcp": [
{
"HostPort": "80"
}
]
},
"Privileged": false,
"PublishAllPorts": false
},
"HostId": "46f8e5e8739f205e67ec852485095e953f079ff5c8f95b9e7c16f331",
"Human_id": "connector",
"Id": "4920a824-66bf-49bd-be71-549d0adeeffc",
"Image": "sha256:080893a1e47927b2fdf3f24a8b0b803fab035c236551e32df9527654c8af698c",
"Mounts": [],
"Name": "connector",
"NetworkSettings": {
"Bridge": "",
"Gateway": "",
"IPAddress": "172.29.0.53",
"IPPrefixLen": 0,
"MacAddress": "fa:16:3e:3a:2e:04",
"Networks": {
"default": {
"Aliases": null,
"EndpointID": "4920a824-66bf-49bd-be71-549d0adeeffc",
"Gateway": "172.29.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAMConfig": null,
"IPAddress": "172.29.0.53",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"Links": null,
"MacAddress": "fa:16:3e:3a:2e:04",
"NetworkID": "bd84d27c-8909-4dcc-a9cf-7dca5453f55c"
}
},
"PortMapping": null,
"Ports": {
"443/tcp": [
{
"HostIp": "169.46.22.55",
"HostPort": "443"
}
],
"80/tcp": [
{
"HostIp": "169.46.22.55",
"HostPort": "80"
}
]
},
"PublicIpAddress": "169.46.22.55"
},
"Path": "date",
"ResolvConfPath": "/etc/resolv.conf",
"State": {
"Error": "",
"ExitCode": 0,
"FinishedAt": "0001-01-01T00:00:00Z",
"Ghost": "",
"Pid": 1,
"Running": true,
"StartedAt": "2017-01-11T06:22:54.000000000Z",
"Status": "Running"
},
"Volumes": {},
"VolumesRW": {}
}
]
You can review information in this page:
https://console.ng.bluemix.net/docs/containers/container_linking.html
I am afraid the the --link is incorrect and you will may have to ensure alias and name are correct.
This command output should help you:
cf ic inspect recipient_container_name
I'm trying to use a docker image from here to start setting up a datascience set up. I can get docker to mount the container using
docker run -d --privileged=true -p 8888:8888 --name ipyn3 -v /home/repos/DoSomeData/:/home/ds/notebooks/ dataquestio/python3-starter
where the host directory "DoSomeData" contains a single folder at the moment "Hillary_Emails" which contains a directory of input data and a single iPython Notebook file.
When I go into ipython notebook, it can see the "Hillary_Emails" directory but nothing else. This is also the case when I log into the container using Bash and run ls. It appears to only be copying over the directory.
Running docker inspect ipyn3 gives
[
{
"Id": "b1cbba654135d46170e78c8ac522601ee743e1b1d3959b10fc7784c57c696433",
"Created": "2016-03-14T20:20:24.413863418Z",
"Path": "/home/ds/run_ipython.sh",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 7629,
"ExitCode": 0,
"Error": "",
"StartedAt": "2016-03-14T20:20:25.344852732Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:3cccab0c85e256d355fd7facbf3b897363bb72f7089ce7d65c54fe55b69ea25d",
"ResolvConfPath": "/var/lib/docker/containers/b1cbba654135d46170e78c8ac522601ee743e1b1d3959b10fc7784c57c696433/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/b1cbba654135d46170e78c8ac522601ee743e1b1d3959b10fc7784c57c696433/hostname",
"HostsPath": "/var/lib/docker/containers/b1cbba654135d46170e78c8ac522601ee743e1b1d3959b10fc7784c57c696433/hosts",
"LogPath": "/var/lib/docker/containers/b1cbba654135d46170e78c8ac522601ee743e1b1d3959b10fc7784c57c696433/b1cbba654135d46170e78c8ac522601ee743e1b1d3959b10fc7784c57c696433-json.log",
"Name": "/ipyn3",
"RestartCount": 0,
"Driver": "devicemapper",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/home/repos/DoSomeData/:/home/ds/notebooks/"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"8888/tcp": [
{
"HostIp": "",
"HostPort": "8888"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": true,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"ShmSize": 67108864,
"ConsoleSize": [
0,
0
],
"Isolation": "",
"CpuShares": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": null,
"BlkioDeviceReadBps": null,
"BlkioDeviceWriteBps": null,
"BlkioDeviceReadIOps": null,
"BlkioDeviceWriteIOps": null,
"CpuPeriod": 0,
"CpuQuota": 0,
"CpusetCpus": "",
"CpusetMems": "",
"Devices": [],
"KernelMemory": 0,
"Memory": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": -1,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null
},
"GraphDriver": {
"Name": "devicemapper",
"Data": {
"DeviceId": "57",
"DeviceName": "docker-253:0-2228497-91a65d788ceb1e1ed5a1ec339d19ba8de24ec574fad57982f6d939ec572df526",
"DeviceSize": "10737418240"
}
},
"Mounts": [
{
"Source": "/home/repos/DoSomeData",
"Destination": "/home/ds/notebooks",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "b1cbba654135",
"Domainname": "",
"User": "ds",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"8888/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"TERM=xterm",
"LANG=en_US.UTF-8",
"HOME=/home/ds",
"SHELL=/bin/bash",
"USER=ds"
],
"Cmd": [
"/home/ds/run_ipython.sh"
],
"Image": "dataquestio/python3-starter",
"Volumes": {
"/home/ds/notebooks": {}
},
"WorkingDir": "/home/ds/notebooks",
"Entrypoint": null,
"OnBuild": null,
"Labels": {},
"StopSignal": "SIGTERM"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "84a7df65aa857432cc7bfcb7c28016eb40eee10c9a6eaf30c46fec3b69f2f673",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8888/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8888"
}
]
},
"SandboxKey": "/var/run/docker/netns/84a7df65aa85",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "c8fe87fc450a97422439751ae1400f44c28656a81375788be214d4b5c7b70686",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "7c709634cd55286747ac4080457e57290db1cdc774d290f59727436223ecf08a",
"EndpointID": "c8fe87fc450a97422439751ae1400f44c28656a81375788be214d4b5c7b70686",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02"
}
}
}
}
]
Does anyone know what is causing this? I'm running Fedora23 and this is the first time I've tried using docker containers. Is it something to do with how permissions are propagating?
Thanks
I ran docker inspect ipyn3 when it was working. Issue was that the source path needed my username after host i.e.
\home\user_name\repos\DoSomeData
I have seen some curl commands to search, pull image etc from docker. Some examples are provided here
What is the equalent code of sudo docker inspect nginx?
In terminal its output is as follows.
[
{
"Id": "319d2015d149943ff4d2a20ddea7d7e5ce06a64bbab1792334c0d3273bbbff1e",
"Parent": "107c338c1d31577c86670a0aa070ed903c9e00802838f9ffb8420a6acfb3dbaf",
"Comment": "",
"Created": "2015-06-16T21:50:45.835843344Z",
"Container": "e9b1150a37d45ba2335ee36436e7d435c1ce1d2960720cd1d06c194c2db13d8f",
"ContainerConfig": {
"Hostname": "6c732c6044b7",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"443/tcp": {},
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NGINX_VERSION=1.9.2-1~jessie"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) CMD [\"nginx\" \"-g\" \"daemon off;\"]"
],
"Image": "107c338c1d31577c86670a0aa070ed903c9e00802838f9ffb8420a6acfb3dbaf",
"Volumes": {
"/var/cache/nginx": {}
},
"VolumeDriver": "",
"WorkingDir": "",
"Entrypoint": null,
"NetworkDisabled": false,
"MacAddress": "",
"OnBuild": [],
"Labels": {}
},
"DockerVersion": "1.6.0",
"Author": "NGINX Docker Maintainers \"docker-maint#nginx.com\"",
"Config": {
"Hostname": "6c732c6044b7",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"PortSpecs": null,
"ExposedPorts": {
"443/tcp": {},
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NGINX_VERSION=1.9.2-1~jessie"
],
"Cmd": [
"nginx",
"-g",
"daemon off;"
],
"Image": "107c338c1d31577c86670a0aa070ed903c9e00802838f9ffb8420a6acfb3dbaf",
"Volumes": {
"/var/cache/nginx": {}
},
"VolumeDriver": "",
"WorkingDir": "",
"Entrypoint": null,
"NetworkDisabled": false,
"MacAddress": "",
"OnBuild": [],
"Labels": {}
},
"Architecture": "amd64",
"Os": "linux",
"Size": 0,
"VirtualSize": 132841390
}
]
Any docker command ( docker ps, docker stats...) is a call to the API. From the latest 1.7 doc https://docs.docker.com/reference/api/docker_remote_api_v1.17/ I see
Inspect a container
GET /containers/(id)/json
Return low-level information on the container id
Example request:
GET /containers/4fa6e0f0c678/json HTTP/1.1