I have an error that only happens when I run docker compose up on one of my docker compose files and not the other, even though the services named "proxy" in which the error occurs are identical.
When I run docker compose -f docker-compose-v1.yml up -d the containers start without issue but on inspection the container named github_proxy_1 has no mounts.
If I run docker-compose -f docker-compose-v2.yml up -d the containers start without issue and on inspection the container named github_proxy_1 has mounts.
The proxy services are based on traefik windows images. I have read that many have had issues with binding volumes so that traefik can communicate with the underlying host, but the weird thing is that it works flawlessly in one setup but not the other.
Below are my docker version info, docker compose files, the results when inspecting the containers (showing the difference in mounts), and the error message from the container log shown in Docker Desktop.
Why does one proxy container manage to populate mounts while the other doesn't?
Thanks in advance!
docker version
Client:
Cloud integration: 1.0.14
Version: 20.10.6
API version: 1.41
Go version: go1.16.3
Git commit: 370c289
Built: Fri Apr 9 22:49:36 2021
OS/Arch: windows/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.6
API version: 1.41 (minimum version 1.24)
Go version: go1.13.15
Git commit: 8728dd2
Built: Fri Apr 9 22:45:40 2021
OS/Arch: windows/amd64
Experimental: false
docker-compose-v1.yml
version: "3.7"
services:
s4-web:
image: s4admin:484-2
build:
context: .
dockerfile: S4/Admin/Dockerfile
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=PathPrefix(`/`)"
networks:
- sg-net
proxy:
image: traefik:v2.3-windowsservercore-1809
command:
- "--providers.docker"
- "--providers.docker.endpoint=npipe:////./pipe/docker_engine"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=sg-net"
- "--entrypoints.web.address=:80"
- "--api.insecure=true"
ports:
- "8080:80"
- "8088:8080"
volumes:
- type: npipe
source: \\.\pipe\docker_engine
target: \\.\pipe\docker_engine
networks:
- sg-net
networks:
sg-net:
docker-compose-v2.yml
version: "3.7"
services:
signup-web:
image: signup-web:02-06
build:
context: ../..
dockerfile: docker/02-06-platform-integration/signup-web/v6/Dockerfile
environment:
- Dependencies:IReferenceDataLoader=SignUp.Web.ReferenceData.ApiReferenceDataLoader
- ReferenceDataApi:Url=http://reference-data-api/api
- Dependencies:IProspectSaveHandler=SignUp.Web.ProspectSave.AsynchronousProspectSaveHandler
- MessageQueue:Url=nats://${HOST_IP}:4222
labels:
- "traefik.enable=true"
- "traefik.http.routers.web.rule=PathPrefix(`/`)"
networks:
- signup-net
proxy:
image: traefik:v2.3-windowsservercore-1809
command:
- "--providers.docker"
- "--providers.docker.endpoint=npipe:////./pipe/docker_engine"
- "--providers.docker.exposedbydefault=false"
- "--providers.docker.network=signup-net"
- "--entrypoints.web.address=:80"
- "--api.insecure=true"
ports:
- "8080:80"
- "8088:8080"
volumes:
- type: npipe
source: \\.\pipe\docker_engine
target: \\.\pipe\docker_engine
networks:
- signup-net
networks:
signup-net:
Result from docker inspect github_proxy_1 showing no mounts:
[
{
"Id": "507bb53f9f7c772221ef858464877d310c4ab48a100f86e49b5e248de67c5921",
"Created": "2021-05-28T07:49:16.3839919Z",
"Path": "/traefik",
"Args": [
"--providers.docker",
"--providers.docker.endpoint=npipe:////./pipe/docker_engine",
"--providers.docker.exposedbydefault=false",
"--providers.docker.network=sg-net",
"--entrypoints.web.address=:80",
"--api.insecure=true"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1312,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-05-28T07:49:22.9474168Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:0011bc7c1cd89741d499d69fe62ed8c50b251d90bb3dd01350d6f945dace6e89",
"ResolvConfPath": "",
"HostnamePath": "",
"HostsPath": "",
"LogPath": "C:\\ProgramData\\Docker\\containers\\507bb53f9f7c772221ef858464877d310c4ab48a100f86e49b5e248de67c5921\\507bb53f9f7c772221ef858464877d310c4ab48a100f86e49b5e248de67c5921-json.log",
"Name": "/github_proxy_1",
"RestartCount": 0,
"Driver": "windowsfilter",
"Platform": "windows",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "github_sg-net",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "8080"
}
],
"8080/tcp": [
{
"HostIp": "",
"HostPort": "8088"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 0,
"ConsoleSize": [
0,
0
],
"Isolation": "hyperv",
"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": null,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": null,
"ReadonlyPaths": null
},
"GraphDriver": {
"Data": {
"dir": "C:\\ProgramData\\Docker\\windowsfilter\\507bb53f9f7c772221ef858464877d310c4ab48a100f86e49b5e248de67c5921"
},
"Name": "windowsfilter"
},
"Mounts": [],
"Config": {
"Hostname": "507bb53f9f7c",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"80/tcp": {},
"8080/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": null,
"Cmd": [
"--providers.docker",
"--providers.docker.endpoint=npipe:////./pipe/docker_engine", "--providers.docker.exposedbydefault=false",
"--providers.docker.network=sg-net",
"--entrypoints.web.address=:80",
"--api.insecure=true"
],
"Image": "sha256:0011bc7c1cd89741d499d69fe62ed8c50b251d90bb3dd01350d6f945dace6e89",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": [
"/traefik"
],
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "ef67d49c829762590f72bf6caa8e34327f9b86915e9e985c9d2fa43177457894",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "github",
"com.docker.compose.project.config_files": "C:\\Dev\\Projects\\SurveyGenerator\\github\\docker-compose-s4.yml",
"com.docker.compose.project.working_dir": "C:\\Dev\\Projects\\SurveyGenerator\\github",
"com.docker.compose.service": "proxy",
"com.docker.compose.version": "1.0-alpha",
"org.opencontainers.image.description": "A modern reverse-proxy",
"org.opencontainers.image.documentation": "https://docs.traefik.io",
"org.opencontainers.image.title": "Traefik",
"org.opencontainers.image.url": "https://traefik.io",
"org.opencontainers.image.vendor": "Traefik Labs",
"org.opencontainers.image.version": "v2.3.7"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "507bb53f9f7c772221ef858464877d310c4ab48a100f86e49b5e248de67c5921",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
}
],
"8080/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8088"
}
]
},
"SandboxKey": "507bb53f9f7c772221ef858464877d310c4ab48a100f86e49b5e248de67c5921",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"github_sg-net": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"proxy",
"github_proxy_1",
"507bb53f9f7c"
],
"NetworkID": "2e5931b8cba8fdd1b2b4e547089c21b85570450437599d13e8af3888263d22e3",
"EndpointID": "87d39c2b7cc69b3090026f8395312704e684d7fb925410895dca1a007473ee41",
"Gateway": "172.27.160.1",
"IPAddress": "172.27.163.11",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "00:15:5d:46:69:3c",
"DriverOpts": null
}
}
}
}
]
Result from docker inspect github_proxy_1 where mounts has values:
[
{
"Id": "a81aae03a323b5efd37f80656dccab0bd102aa903d34803554456f0661c22c99",
"Created": "2021-05-28T08:21:05.6675713Z",
"Path": "/traefik",
"Args": [
"--providers.docker",
"--providers.docker.endpoint=npipe:////./pipe/docker_engine",
"--providers.docker.exposedbydefault=false",
"--providers.docker.network=signup-net",
"--entrypoints.web.address=:80",
"--api.insecure=true"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1328,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-05-28T08:21:10.4771044Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:0011bc7c1cd89741d499d69fe62ed8c50b251d90bb3dd01350d6f945dace6e89",
"ResolvConfPath": "",
"HostnamePath": "",
"HostsPath": "",
"LogPath": "C:\\ProgramData\\Docker\\containers\\a81aae03a323b5efd37f80656dccab0bd102aa903d34803554456f0661c22c99\\a81aae03a323b5efd37f80656dccab0bd102aa903d34803554456f0661c22c99-json.log",
"Name": "/03_proxy_1",
"RestartCount": 0,
"Driver": "windowsfilter",
"Platform": "windows",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "03_signup-net",
"PortBindings": {
"80/tcp": [
{
"HostIp": "",
"HostPort": "8080"
}
],
"8080/tcp": [
{
"HostIp": "",
"HostPort": "8088"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 0,
"ConsoleSize": [
0,
0
],
"Isolation": "hyperv",
"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": null,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": null,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"Mounts": [
{
"Type": "npipe",
"Source": "\\\\.\\pipe\\docker_engine",
"Target": "\\\\.\\pipe\\docker_engine"
}
],
"MaskedPaths": null,
"ReadonlyPaths": null
},
"GraphDriver": {
"Data": {
"dir": "C:\\ProgramData\\Docker\\windowsfilter\\a81aae03a323b5efd37f80656dccab0bd102aa903d34803554456f0661c22c99"
},
"Name": "windowsfilter"
},
"Mounts": [
{
"Type": "npipe",
"Source": "\\\\.\\pipe\\docker_engine",
"Destination": "\\\\.\\pipe\\docker_engine",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "a81aae03a323",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"80/tcp": {},
"8080/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": null,
"Cmd": [
"--providers.docker",
"--providers.docker.endpoint=npipe:////./pipe/docker_engine",
"--providers.docker.exposedbydefault=false",
"--providers.docker.network=signup-net",
"--entrypoints.web.address=:80",
"--api.insecure=true"
],
"Image": "traefik:v2.3-windowsservercore-1809",
"Volumes": null,
"WorkingDir": "",
"Entrypoint": [
"/traefik"
],
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "53f350716aad96821fea12154c09bf70e538394230171e0139d28b0ea8b6a2c6",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "03",
"com.docker.compose.project.config_files": "app\\03\\v7-windows.yml",
"com.docker.compose.project.working_dir": "C:\\Dev\\Projects\\docker4dotnet\\app\\03",
"com.docker.compose.service": "proxy",
"com.docker.compose.version": "1.29.1",
"org.opencontainers.image.description": "A modern reverse-proxy",
"org.opencontainers.image.documentation": "https://docs.traefik.io",
"org.opencontainers.image.title": "Traefik",
"org.opencontainers.image.url": "https://traefik.io",
"org.opencontainers.image.vendor": "Traefik Labs",
"org.opencontainers.image.version": "v2.3.7"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "a81aae03a323b5efd37f80656dccab0bd102aa903d34803554456f0661c22c99",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
}
],
"8080/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8088"
}
]
},
"SandboxKey": "a81aae03a323b5efd37f80656dccab0bd102aa903d34803554456f0661c22c99",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"03_signup-net": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"a81aae03a323",
"proxy"
],
"NetworkID": "1a464d92f0625acd600391c7b2204d33e54cb94b1bf4a098ca0a48e5f4067edc",
"EndpointID": "fde1dace014a898a4cee3fb624ce1a1ec74f87a565b3cb4696e895037774e57d",
"Gateway": "172.29.0.1",
"IPAddress": "172.29.12.143",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "00:15:5d:2f:e3:79",
"DriverOpts": null
}
}
}
}
]
Logged error message in docker desktop for the github_proxy_1 container without mounts:
time="2021-05-28T09:49:25+02:00" level=error msg="Failed to retrieve information of the docker client and server host: error during connect: This error may indicate that the docker daemon is not running.: Get \"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version\": open //./pipe/docker_engine: The system cannot find the file specified." providerName=docker
time="2021-05-28T09:49:25+02:00" level=error msg="Provider connection error error during connect: This error may indicate that the docker daemon is not running.: Get \"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version\": open //./pipe/docker_engine: The system cannot find the file specified., retrying in 552.330144ms" providerName=docker
So I found the problem. I was using docker-compose (using the docker-compose binary) for the compose that worked and docker compose for the one that didn't.
The question remains why one works and the other doesn't, what is the difference of running docker-compose vs docker compose? Does it perhaps somehow have to do with permissions?
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.
I have installed docker toolsbox in windows 10.
I have created a container for mysql for the an application using the docker command as given. I'm able to create it and also able to view it using the docker container ls command, but only for the first time.
The Problem occurs when closing the docker toolsbox and reopen it.
When I issued the docker container ls command, I'm unable to find any of the containers what I have created.
But When I tried to inspect the container I'm able to view the container details.
Attached the screenshot and json details of the container.
Please let me know in case of more information needed.
Docker command for creating the MySQL container
docker run --name mysql-docker-petclinic -e MYSQL_ROOT_PASSWORD=admin -e MYSQL_DATABASE=petclinic -e MYSQL_USERNAME=root -e MYSQL_PASSWORD=admin -p 3306:3306 -d mysql:latest
Inspect Command Details
$ docker container inspect mysql-docker-petclinic
[
{
"Id": "f30f66154b7398bbfd1b65d34afc0d973ecdbe62d0e2cbd654003775d11499e0",
"Created": "2018-02-25T16:28:10.327158448Z",
"Path": "docker-entrypoint.sh",
"Args": [
"mysqld"
],
"State": {
"Status": "exited",
"Running": false,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 0,
"ExitCode": 255,
"Error": "",
"StartedAt": "2018-02-25T16:28:12.428822667Z",
"FinishedAt": "2018-02-26T04:38:54.98958199Z"
},
"Image": "sha256:f0f3956a9dd825e3195f0d1a4fe17cc94b0f6934fc470b09abf8fad87d17ff24",
"ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/f30f66154b7398bbfd1b65d34afc0d973ecdbe62d0e2cbd654003775d11499e0/resolv.conf",
"HostnamePath": "/mnt/sda1/var/lib/docker/containers/f30f66154b7398bbfd1b65d34afc0d973ecdbe62d0e2cbd654003775d11499e0/hostname",
"HostsPath": "/mnt/sda1/var/lib/docker/containers/f30f66154b7398bbfd1b65d34afc0d973ecdbe62d0e2cbd654003775d11499e0/hosts",
"LogPath": "/mnt/sda1/var/lib/docker/containers/f30f66154b7398bbfd1b65d34afc0d973ecdbe62d0e2cbd654003775d11499e0/f30f66154b7398bbfd1b65d34afc0d973ecdbe62d0e2cbd654003775d11499e0-json.log",
"Name": "/mysql-docker-petclinic",
"RestartCount": 0,
"Driver": "aufs",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"3306/tcp": [
{
"HostIp": "",
"HostPort": "3306"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 67108864,
"Runtime": "runc",
"ConsoleSize": [
30,
120
],
"Isolation": "",
"CpuShares": 0,
"Memory": 0,
"NanoCpus": 0,
"CgroupParent": "",
"BlkioWeight": 0,
"BlkioWeightDevice": [],
"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": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": null,
"Name": "aufs"
},
"Mounts": [
{
"Type": "volume",
"Name": "7195ae34c4698fbcdf3737962e799e991e0268a33ea6126af8b0e4aa24b2b18e",
"Source": "/mnt/sda1/var/lib/docker/volumes/7195ae34c4698fbcdf3737962e799e991e0268a33ea6126af8b0e4aa24b2b18e/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "f30f66154b73",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_ROOT_PASSWORD=admin",
"MYSQL_DATABASE=petclinic",
"MYSQL_USERNAME=root",
"MYSQL_PASSWORD=admin",
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.7",
"MYSQL_MAJOR=5.7",
"MYSQL_VERSION=5.7.21-1debian8"
],
"Cmd": [
"mysqld"
],
"ArgsEscaped": true,
"Image": "mysql:latest",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "0f9a23a942344c2e7c23d425456787db327278dec4601447eb526dfdaa9c3abb",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3306"
}
]
},
"SandboxKey": "/var/run/docker/netns/0f9a23a94234",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "*********************************************************",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "*********************************",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "*********************************************************",
"EndpointID": "*********************************************************",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "*********************************************************",
"DriverOpts": null
}
}
}
}
]
Screenshots
1. Docker ls command
2. Docker Inspect Command Details
------------- UPDATE -------------
docker container ls by default shows only the running container.
closing the docker toolsbox and reopen it
That means all your containers are now in "Exited" state.
Try:
docker container ls --all
See also docker ps -a
I am following the Docker page to run a local registry (https://docs.docker.com/registry/deploying/#run-a-local-registry). The registry container is running, but when I try to do docker push localhost:5000/nginx I get this error:
Get https://localhost:5000/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
I am, however, able to push using docker push 127.0.0.1:5000/nginx.
Any suggestions as to why this isn't working?
EDITED:
Here is my /etc/resolve.conf
domain bskyb.com
nameserver 172.20.220.26
nameserver 172.20.220.25
nameserver 10.5.212.21
The commands I ran:
[mwa51#OSTML0253700 ~] 2018-01-17 16:16:08$ docker push localhost:5000/nginx
The push refers to repository [localhost:5000/nginx]
Get https://localhost:5000/v2/: net/http: request canceled while
waiting for connection (Client.Timeout exceeded while awaiting headers)
[mwa51#OSTML0253700 ~] 2018-01-17 16:16:31$
[mwa51#OSTML0253700 ~] 2018-01-17 16:16:31$ docker push 127.0.0.1:5000/nginx
The push refers to repository [127.0.0.1:5000/nginx]
a103d141fc98: Layer already exists
73e2bd445514: Layer already exists
2ec5c0a4cb57: Layer already exists
1.13: digest:
sha256:926b086e1234b6ae9a11589c4cece66b267890d24d1da388c96dd8795b2ffcfb
size: 948
a103d141fc98: Layer already exists
73e2bd445514: Layer already exists
2ec5c0a4cb57: Layer already exists
latest: digest:
sha256:926b086e1234b6ae9a11589c4cece66b267890d24d1da388c96dd8795b2ffcfb
size: 948
[mwa51#OSTML0253700 ~] 2018-01-17 16:17:59$
And the output of docker inspect registry:
[
{
"Id": "bc9d9dd7e6d07d36176a542814375230c1d2e1f154993b832485f0b61af8c9d7",
"Created": "2018-01-17T10:16:01.269327669Z",
"Path": "/entrypoint.sh",
"Args": [
"/etc/docker/registry/config.yml"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 2431,
"ExitCode": 0,
"Error": "",
"StartedAt": "2018-01-17T16:15:32.851068237Z",
"FinishedAt": "2018-01-17T16:15:31.007531371Z"
},
"Image": "sha256:d1fd7d86a8257f3404f92c4474fb3353076883062d64a09232d95d940627459d",
"ResolvConfPath": "/var/lib/docker/containers/bc9d9dd7e6d07d36176a542814375230c1d2e1f154993b832485f0b61af8c9d7/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/bc9d9dd7e6d07d36176a542814375230c1d2e1f154993b832485f0b61af8c9d7/hostname",
"HostsPath": "/var/lib/docker/containers/bc9d9dd7e6d07d36176a542814375230c1d2e1f154993b832485f0b61af8c9d7/hosts",
"LogPath": "/var/lib/docker/containers/bc9d9dd7e6d07d36176a542814375230c1d2e1f154993b832485f0b61af8c9d7/bc9d9dd7e6d07d36176a542814375230c1d2e1f154993b832485f0b61af8c9d7-json.log",
"Name": "/registry",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"5000/tcp": [
{
"HostIp": "",
"HostPort": "5000"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "shareable",
"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": [],
"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": null,
"OomKillDisable": false,
"PidsLimit": 0,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/cc234dacc7f73dbbb58dbab1ca0109e57d4a470c225e20daf69678a9c53cb8e2-init/diff:/var/lib/docker/overlay2/7acfd81c53735574cf334d7bb4779136cc8a510886105850c12af7cf785d56a5/diff:/var/lib/docker/overlay2/462af7abc4dc1df8e7760d274616fc98ec2484450ef92a38702370696c6b2e77/diff:/var/lib/docker/overlay2/2e74aa672b9a2f6fef960d9411725ffbbf0b0c233326915f089da46d597c8888/diff:/var/lib/docker/overlay2/37b9a8f667053beee899b031cec8e473f0273b3582ea20e4bea2477737bf0065/diff:/var/lib/docker/overlay2/1508860708a3fb5c720eee143063f02c852548e9f608b4e56470cba86d2b98a9/diff",
"MergedDir": "/var/lib/docker/overlay2/cc234dacc7f73dbbb58dbab1ca0109e57d4a470c225e20daf69678a9c53cb8e2/merged",
"UpperDir": "/var/lib/docker/overlay2/cc234dacc7f73dbbb58dbab1ca0109e57d4a470c225e20daf69678a9c53cb8e2/diff",
"WorkDir": "/var/lib/docker/overlay2/cc234dacc7f73dbbb58dbab1ca0109e57d4a470c225e20daf69678a9c53cb8e2/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "9f79a52daf7489c22409cf1629d01367d300a7f2519d3861579e43c73735a332",
"Source": "/var/lib/docker/volumes/9f79a52daf7489c22409cf1629d01367d300a7f2519d3861579e43c73735a332/_data",
"Destination": "/var/lib/registry",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "bc9d9dd7e6d0",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"5000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"/etc/docker/registry/config.yml"
],
"ArgsEscaped": true,
"Image": "registry:2",
"Volumes": {
"/var/lib/registry": {}
},
"WorkingDir": "",
"Entrypoint": [
"/entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "95e9979b7c9a9081262252d595c39b1601062f549b1ba16c7ac4fd7e1b5b04e8",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"5000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "5000"
}
]
},
"SandboxKey": "/var/run/docker/netns/95e9979b7c9a",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "d55c67127f6fcb6a29c9aafcf3eda3f641f0854f2ae1054469b25142bb0f5f15",
"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": "4dfe4b88f1906649d86797d7980908b7a6b5a5dadc40d9117340de6fd115e0f4",
"EndpointID": "d55c67127f6fcb6a29c9aafcf3eda3f641f0854f2ae1054469b25142bb0f5f15",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:02",
"DriverOpts": null
}
}
}
}
]
And also:
[mwa51#OSTML0253700 ~] 2018-01-17 16:21:28$ echo $DOCKER_HOST
returns blank
http://localhost:4200 doesn't work on host
But server is running inside container
docker exec 697bf01cf064 curl http://0.0.0.0:4200/
<!doctype html>
...
This command
docker-machine ip default
returns
192.168.99.100
http://192.168.99.100:4200 doesn't work too
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
697bf01cf064 wepoll_wepoll-ui-webpack-docker "npm start --host=..." 19 minutes ago Up 19 minutes 0.0.0.0:4200->4200/tcp, 0.0.0.0:49152->49152/tcp wepoll-ui-webpack-docker
EXPOSE 4200 49152 in Dockerfile
networks:
dev-network:
driver: bridge
Network driver - bridge
How to access container server from host? Firewall disabled.
docker inpect 68e5e3524906
[
{
"Id": "68e5e3524906d621f3abc3cdfcb58e740290bb12a2082e44c14e180fecabb111",
"Created": "2017-02-01T16:56:34.52365653Z",
"Path": "npm",
"Args": [
"start",
"--host=0.0.0.0"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 4483,
"ExitCode": 0,
"Error": "",
"StartedAt": "2017-02-01T16:56:34.833112923Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:a8aa417d60182b300836ce3f556bf90ae5b71fcf1ef9f76f4ef0d41b461934d1",
"ResolvConfPath": "/mnt/sda1/var/lib/docker/containers/68e5e3524906d621f3abc3cdfcb58e740290bb12a2082e44c14e180fecabb111/resolv.conf",
"HostnamePath": "/mnt/sda1/var/lib/docker/containers/68e5e3524906d621f3abc3cdfcb58e740290bb12a2082e44c14e180fecabb111/hostname",
"HostsPath": "/mnt/sda1/var/lib/docker/containers/68e5e3524906d621f3abc3cdfcb58e740290bb12a2082e44c14e180fecabb111/hosts",
"LogPath": "/mnt/sda1/var/lib/docker/containers/68e5e3524906d621f3abc3cdfcb58e740290bb12a2082e44c14e180fecabb111/68e5e3524906d621f3abc3cdfcb58e740290bb12a2082e44c14e180fecabb111-json.log",
"Name": "/wepoll-ui-webpack-docker",
"RestartCount": 0,
"Driver": "aufs",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": [],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "wepoll_dev-network",
"PortBindings": {
"4200/tcp": [
{
"HostIp": "",
"HostPort": "4200"
}
],
"49152/tcp": [
{
"HostIp": "",
"HostPort": "49152"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"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": 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": {
"Name": "aufs",
"Data": null
},
"Mounts": [],
"Config": {
"Hostname": "68e5e3524906",
"Domainname": "",
"User": "app",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"4200/tcp": {},
"49152/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"NPM_CONFIG_LOGLEVEL=info",
"NODE_VERSION=6.6.0",
"HOME=/home/app",
"APP_NAME=wepoll-ui-webpack-docker"
],
"Cmd": [
"npm",
"start",
"--host=0.0.0.0"
],
"Image": "wepoll_wepoll-ui-webpack-docker",
"Volumes": null,
"WorkingDir": "/home/app/wepoll-ui-webpack-docker",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "b1e41fe8d248646d782943b8997d539b910c984b9a862335c080458afd44bd1e",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "wepoll",
"com.docker.compose.service": "wepoll-ui-webpack-docker",
"com.docker.compose.version": "1.10.0"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "7b8e3391317a645ec316183e6d1f8a4865418185598d8088d47f808987006bbf",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"4200/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "4200"
}
],
"49152/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "49152"
}
]
},
"SandboxKey": "/var/run/docker/netns/7b8e3391317a",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"wepoll_dev-network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"wepoll-ui-webpack-docker",
"68e5e3524906"
],
"NetworkID": "4c5594b896a4050f60133f44e494021aaf5606488d22af963561febb0ee6049b",
"EndpointID": "603c3628945054bd62a9deaa574a782241b544502bb525333f2865da3f705d9a",
"Gateway": "172.19.0.1",
"IPAddress": "172.19.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:13:00:02"
}
}
}
}
]
Debugging:
The fact that you are unable to browse app at ${host_ip}:4200 means that it could be possible that the port is not exposed properly.
But the output for docker ps under the PORTS section has...
0.0.0.0:4200->4200/tcp
...which means that port has been exposed correctly.
Let's check if the port over the container's IP is reachable (to remove any suspicions on firewalls)
The output for docker inspect ${container_id} shows that your container IP is 172.19.0.2 (and also proves that the port bindings are correct). But http://172.19.0.2:4200 is also not reachable.
But you already mentioned that curl 0.0.0.0 inside machine works, but 0.0.0.0, in this context, means "all IP addresses on the local machine" (in fact probably, "all IPv4 addresses on the local machine"), which also includes 127.0.0.1 aka localhost, which doesn't prove that your app is listening on all interfaces.
Now you say that you started the app with --host=0.0.0.0, but I think you can still override it inside the app code.
So, the best case scenario is to inspect how the app server is started.
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