Related
I'm trying to setup GitLab in my local machine and install GitLab and GitLab Runner in Docker:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
f041339388c2 gitlab/gitlab-runner:latest "/usr/bin/dumb-init …" 19 minutes ago Up 19 minutes gitlab-runner
c3a1e9b99f38 gitlab/gitlab-ce:latest "/assets/wrapper" 46 hours ago Up About an hour (healthy) 0.0.0.0:22->22/tcp, :::22->22/tcp, 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, :::443->443/tcp gitlab
Container inspect for gitlab:
[
{
"Id": "c3a1e9b99f383031c2ab60d55d5b51b6081cb14cd99eaffbfd59f13b283261fb",
"Created": "2022-04-05T21:19:13.902999235Z",
"Path": "/assets/wrapper",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 1533,
"ExitCode": 0,
"Error": "",
"StartedAt": "2022-04-07T17:53:01.529265764Z",
"FinishedAt": "2022-04-06T21:58:58.315886026Z",
"Health": {
"Status": "healthy",
"FailingStreak": 0,
"Log": [
{
"Start": "2022-04-08T06:51:09.70727281+12:00",
"End": "2022-04-08T06:51:09.879538644+12:00",
"ExitCode": 0,
"Output": "OUTPUT PATH"
},
{
"Start": "2022-04-08T06:52:09.883781229+12:00",
"End": "2022-04-08T06:52:10.007407598+12:00",
"ExitCode": 0,
"Output": "OUTPUT PATH"
},
{
"Start": "2022-04-08T06:53:10.012089806+12:00",
"End": "2022-04-08T06:53:10.123264724+12:00",
"ExitCode": 0,
"Output": "OUTPUT PATH"
},
{
"Start": "2022-04-08T06:54:10.12809284+12:00",
"End": "2022-04-08T06:54:10.273646619+12:00",
"ExitCode": 0,
"Output": "OUTPUT PATH"
},
{
"Start": "2022-04-08T06:55:10.279143578+12:00",
"End": "2022-04-08T06:55:10.399512189+12:00",
"ExitCode": 0,
"Output": "OUTPUT PATH"
}
]
}
},
"Image": "sha256:9c00b5927bae442d3f8902f5c3bb58acb849fb1969d4ce85eb1699b3618729b8",
"ResolvConfPath": "/var/lib/docker/containers/c3a1e9b99f383031c2ab60d55d5b51b6081cb14cd99eaffbfd59f13b283261fb/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/c3a1e9b99f383031c2ab60d55d5b51b6081cb14cd99eaffbfd59f13b283261fb/hostname",
"HostsPath": "/var/lib/docker/containers/c3a1e9b99f383031c2ab60d55d5b51b6081cb14cd99eaffbfd59f13b283261fb/hosts",
"LogPath": "/var/lib/docker/containers/c3a1e9b99f383031c2ab60d55d5b51b6081cb14cd99eaffbfd59f13b283261fb/c3a1e9b99f383031c2ab60d55d5b51b6081cb14cd99eaffbfd59f13b283261fb-json.log",
"Name": "/gitlab",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/srv/gitlab/config:/etc/gitlab",
"/srv/gitlab/logs:/var/log/gitlab",
"/srv/gitlab/data:/var/opt/gitlab"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"22/tcp": [
{
"HostIp": "",
"HostPort": "22"
}
],
"443/tcp": [
{
"HostIp": "",
"HostPort": "443"
}
],
"80/tcp": [
{
"HostIp": "",
"HostPort": "80"
}
]
},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"Cgroup": "",
"Links": null,
"OomScoreAdj": 0,
"PidMode": "",
"Privileged": false,
"PublishAllPorts": false,
"ReadonlyRootfs": false,
"SecurityOpt": null,
"UTSMode": "",
"UsernsMode": "",
"ShmSize": 268435456,
"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,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/4b28b6be75c79e41a90500a09d4493634e5fe95a1cdf38883c5bf3ad03c8ee02-init/diff:/var/lib/docker/overlay2/2b3bc79dfce88dc46d755ac2a57da59518b3c42e9143d81b42cf504079c5d9c9/diff:/var/lib/docker/overlay2/af25bc18d7ad1bca032219d6ed91de5c5c1eb585f59be7cdbdd6f87d9bfccb7c/diff:/var/lib/docker/overlay2/9b057ce4d478064a7ad4cc7b82819412b6353adf09b5564951b38f5bd17bcb87/diff:/var/lib/docker/overlay2/b6028dcc6d0b368ff1491e7d81a12a90eef1f68ea825543919b4b5fd7f3ad68b/diff:/var/lib/docker/overlay2/52ad6a00a274686a676a3c2f7c51e230fd3de77b9018dd9af9f73c26e143c547/diff:/var/lib/docker/overlay2/21fa78d0cf6e3b07a8b846b7b6e625c8a674f6f3b94e06c17532587c9174e622/diff:/var/lib/docker/overlay2/2dddf7eb7d91e36c86c873ad2577dab5ce095251f976995ca5d750595c9761fd/diff:/var/lib/docker/overlay2/6e52ab5f9066fe6d20c1985af0d505315977355ef34b3962142fd3cd665d0591/diff",
"MergedDir": "/var/lib/docker/overlay2/4b28b6be75c79e41a90500a09d4493634e5fe95a1cdf38883c5bf3ad03c8ee02/merged",
"UpperDir": "/var/lib/docker/overlay2/4b28b6be75c79e41a90500a09d4493634e5fe95a1cdf38883c5bf3ad03c8ee02/diff",
"WorkDir": "/var/lib/docker/overlay2/4b28b6be75c79e41a90500a09d4493634e5fe95a1cdf38883c5bf3ad03c8ee02/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/srv/gitlab/config",
"Destination": "/etc/gitlab",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/srv/gitlab/logs",
"Destination": "/var/log/gitlab",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/srv/gitlab/data",
"Destination": "/var/opt/gitlab",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "gitlab.example.com",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"22/tcp": {},
"443/tcp": {},
"80/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/opt/gitlab/embedded/bin:/opt/gitlab/bin:/assets:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"EDITOR=/bin/vi",
"TERM=xterm"
],
"Cmd": [
"/assets/wrapper"
],
"Healthcheck": {
"Test": [
"CMD-SHELL",
"/opt/gitlab/bin/gitlab-healthcheck --fail --max-time 10"
],
"Interval": 60000000000,
"Timeout": 30000000000,
"Retries": 5
},
"Image": "gitlab/gitlab-ce:latest",
"Volumes": {
"/etc/gitlab": {},
"/var/log/gitlab": {},
"/var/opt/gitlab": {}
},
"WorkingDir": "",
"Entrypoint": null,
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "57128e6ffed42d70c4979dd5021f063d8426c5f95ae4f5f60791f302b991d455",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"22/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "22"
},
{
"HostIp": "::",
"HostPort": "22"
}
],
"443/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "443"
},
{
"HostIp": "::",
"HostPort": "443"
}
],
"80/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "80"
},
{
"HostIp": "::",
"HostPort": "80"
}
]
},
"SandboxKey": "/var/run/docker/netns/57128e6ffed4",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "5304f85f8b4fcf9e4b6e3febeef987e89cc71338132b7624e44d7e3e6f7466dc",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "9de2792fcb1439008ecc6412483f657c2d958f20c681782525f209e12f4c2dc3",
"EndpointID": "5304f85f8b4fcf9e4b6e3febeef987e89cc71338132b7624e44d7e3e6f7466dc",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:03",
"DriverOpts": null
},
"gitlab-network": {
"IPAMConfig": {},
"Links": null,
"Aliases": [
"c3a1e9b99f38",
"gitlab.example.com"
],
"NetworkID": "91536b80663973f3e96ea988a398763627d8678b90897c9c2af2234e4850f568",
"EndpointID": "2b53bcd1b619c68d69fb9bcab8db3ab763c3808ed3a466b378e1a4323f76cb48",
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:03",
"DriverOpts": {}
}
}
}
}
]
Container inspect for gitlab-runner:
[
{
"Id": "f041339388c240b147ee82658dbe33feca8f73d556d208ac8aca303199895ed8",
"Created": "2022-04-07T18:33:41.706840368Z",
"Path": "/usr/bin/dumb-init",
"Args": [
"/entrypoint",
"run",
"--user=gitlab-runner",
"--working-directory=/home/gitlab-runner"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 11086,
"ExitCode": 0,
"Error": "",
"StartedAt": "2022-04-07T18:33:41.971920584Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:9b9fc292da4ab1898e96ebccba7b70d28996c7ba97782743ceb6508253856fb7",
"ResolvConfPath": "/var/lib/docker/containers/f041339388c240b147ee82658dbe33feca8f73d556d208ac8aca303199895ed8/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/f041339388c240b147ee82658dbe33feca8f73d556d208ac8aca303199895ed8/hostname",
"HostsPath": "/var/lib/docker/containers/f041339388c240b147ee82658dbe33feca8f73d556d208ac8aca303199895ed8/hosts",
"LogPath": "/var/lib/docker/containers/f041339388c240b147ee82658dbe33feca8f73d556d208ac8aca303199895ed8/f041339388c240b147ee82658dbe33feca8f73d556d208ac8aca303199895ed8-json.log",
"Name": "/gitlab-runner",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/srv/gitlab-runner/config:/etc/gitlab-runner",
"/var/run/docker.sock:/var/run/docker.sock"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "gitlab-network",
"PortBindings": {},
"RestartPolicy": {
"Name": "always",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"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,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/962a04960331a5d6282b9f5a673184560d5d668183137a373e3671346dc5a764-init/diff:/var/lib/docker/overlay2/1ed4db10a6e68c0c4fc9f902d1dcd74a94a4b6d26a159df5214256ea605a1c7e/diff:/var/lib/docker/overlay2/c2d172e960e7aca15c2564e86302418b14838cf976b74d11312281327e0dd437/diff:/var/lib/docker/overlay2/6e52ab5f9066fe6d20c1985af0d505315977355ef34b3962142fd3cd665d0591/diff",
"MergedDir": "/var/lib/docker/overlay2/962a04960331a5d6282b9f5a673184560d5d668183137a373e3671346dc5a764/merged",
"UpperDir": "/var/lib/docker/overlay2/962a04960331a5d6282b9f5a673184560d5d668183137a373e3671346dc5a764/diff",
"WorkDir": "/var/lib/docker/overlay2/962a04960331a5d6282b9f5a673184560d5d668183137a373e3671346dc5a764/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "83f4f2d800709ce627753a2e086f965e40b8bf51bbc85fab91ddfc98f8e4f31e",
"Source": "/var/lib/docker/volumes/83f4f2d800709ce627753a2e086f965e40b8bf51bbc85fab91ddfc98f8e4f31e/_data",
"Destination": "/home/gitlab-runner",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
},
{
"Type": "bind",
"Source": "/srv/gitlab-runner/config",
"Destination": "/etc/gitlab-runner",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "bind",
"Source": "/var/run/docker.sock",
"Destination": "/var/run/docker.sock",
"Mode": "",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "f041339388c2",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"run",
"--user=gitlab-runner",
"--working-directory=/home/gitlab-runner"
],
"Image": "gitlab/gitlab-runner:latest",
"Volumes": {
"/etc/gitlab-runner": {},
"/home/gitlab-runner": {}
},
"WorkingDir": "",
"Entrypoint": [
"/usr/bin/dumb-init",
"/entrypoint"
],
"OnBuild": null,
"Labels": {},
"StopSignal": "SIGQUIT"
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "ca7e0de2c2cc29fa673eb196bedca2b44d23e5f86d7f7ed6cde27593c8b0272e",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {},
"SandboxKey": "/var/run/docker/netns/ca7e0de2c2cc",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "",
"Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
"MacAddress": "",
"Networks": {
"gitlab-network": {
"IPAMConfig": null,
"Links": null,
"Aliases": [
"f041339388c2"
],
"NetworkID": "91536b80663973f3e96ea988a398763627d8678b90897c9c2af2234e4850f568",
"EndpointID": "7943e697deb3890b39afd71175ca8c7df92e96e5952d725f64b7475c15c12025",
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:02",
"DriverOpts": null
}
}
}
}
]
From host machine I'm able to access gitlab using http://172.18.0.3/ and the only part which is left is registering the gitlab-runner but while I'm doing this part I'm getting I/O timeout error
$ sudo docker run --rm -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register \
> --non-interactive \
> --executor "docker" \
> --docker-image alpine:latest \
> --url "http://172.18.0.3/" \
> --registration-token "GR1348941z4tNrqhtAWm2-HTNzqPd" \
> --description "docker-runner" \
> --maintenance-note "Free-form maintainer notes about this runner" \
> --tag-list "docker,aws" \
> --run-untagged="true" \
> --locked="false" \
> --access-level="not_protected"
Runtime platform arch=amd64 os=linux pid=7 revision=bd40e3da version=14.9.1
Running in system-mode.
ERROR: Registering runner... failed runner=GR134894 status=couldn't execute POST against http://172.18.0.3/api/v4/runners: Post "http://172.18.0.3/api/v4/runners": dial tcp 172.18.0.3:80: i/o timeout
PANIC: Failed to register the runner.
Docker containers started separately cannot communicate with each other unless their networks are explicitly linked. That is why you are getting an I/O error from your runner container.
To address this issue, either attach both containers to the same docker network (docker-compose makes this easy) or use host networking (--network=host) when running both containers and use localhost as the GitLab URL and registration target.
Additional reference:
Docker networking tutorial
Docker compose reference (see links:, aliases: and networks:)
Docker network connect
I am trying to get a containers git folder into my local folder. (bind containers folder with my computers local folder) as in images description when I do like this
docker run -p 8080:8080 -p 8001:8001 -v $(pwd):/opt/jboss/wildfly/bin/.niogit:Z -d --name jbpm-workbench jboss/business-central-workbench-showcase:latest
everything works as expected. But if I try this in docker-compose file:
version: "3.9"
services: business-central:
image: jboss/business-central-workbench-showcase:latest
network_mode: default
ports:
- 8080:8080
- 8001:8001
volumes:
- ./git:/opt/jboss/wildfly/bin/.niogit:Z
it does not work.
when I inspect containers docker run one says
[
{
"Id": "050a4dceb241d04f5e92d1d963a73646e1a8559ff3094c1705229bd2ad22859a",
"Created": "2021-06-08T09:11:04.082653292Z",
"Path": "./start_business-central-wb.sh",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 62316,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-06-08T09:11:04.423834376Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:a84b58b28277164c45aaef1a44a5070e883e5ae7d1732164af6694fca9313479",
"ResolvConfPath": "/var/lib/docker/containers/050a4dceb241d04f5e92d1d963a73646e1a8559ff3094c1705229bd2ad22859a/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/050a4dceb241d04f5e92d1d963a73646e1a8559ff3094c1705229bd2ad22859a/hostname",
"HostsPath": "/var/lib/docker/containers/050a4dceb241d04f5e92d1d963a73646e1a8559ff3094c1705229bd2ad22859a/hosts",
"LogPath": "/var/lib/docker/containers/050a4dceb241d04f5e92d1d963a73646e1a8559ff3094c1705229bd2ad22859a/050a4dceb241d04f5e92d1d963a73646e1a8559ff3094c1705229bd2ad22859a-json.log",
"Name": "/jbpm-workbench",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/home/bahadir/Documents/Projects/kosgeb-engine:/opt/jboss/wildfly/bin/.niogit:Z"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"8001/tcp": [
{
"HostIp": "",
"HostPort": "8001"
}
],
"8080/tcp": [
{
"HostIp": "",
"HostPort": "8080"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"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,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/acb0b2ead431d53fa4bb06a663b3dda5274d1b9bf770e47da952173c5f574a58-init/diff:/var/lib/docker/overlay2/d6e0af68bcecebe63a2084109e8ea402323b5639ad4930e3810404e1a004b1b0/diff:/var/lib/docker/overlay2/11503e1a3cbe3ccaf2a08bd53163fad56568e125c4315f8f11ed26b348c6a296/diff:/var/lib/docker/overlay2/452b79bce41d21a121fe1d517b8f41e29b63943cc880697bf78372e3e3f4dede/diff:/var/lib/docker/overlay2/6da58405868eee65c7e8fc5a96133dc3960fa02ef1e6e38fb341ca58d05d943d/diff:/var/lib/docker/overlay2/918f9536c42ee86146011fdc95cb1fa496b6c787849719c621764e178e78127e/diff:/var/lib/docker/overlay2/9bf60d043c0e84a69a321017b19a4d89ac3e242207ba00c7dc685e30d7e962bf/diff:/var/lib/docker/overlay2/ebd7aceb50c16e9d98d947efbda24518187019fc77f86d867a2f173a3a5260f0/diff:/var/lib/docker/overlay2/aa89eb5308ae3a52abe04fd56bc8485d77d31ee87098e19808dcfbf4c4bdc786/diff:/var/lib/docker/overlay2/7e65422f205cffb53ff2e8726f49c2e72392b72b4765081bae3a0a8eb3021fc6/diff:/var/lib/docker/overlay2/de58fc4c63bfefd3262d122af87c5f2ef855aa13c6b9e96ee2dfd91e54292ede/diff:/var/lib/docker/overlay2/d5cbc322dcecb6404123d32c28b00b0b8e57eb69d575f27a223a3e87975a55c0/diff:/var/lib/docker/overlay2/c83b9acd413abf540a9d00708a8d3ad7533e7a374788a0950b0f151ddb7c41d6/diff:/var/lib/docker/overlay2/5860d1bf949d13bf2fa6d8d6d0b920952096f49ea53813b6cc62c6873832d514/diff:/var/lib/docker/overlay2/4c588e89452e1b0303a5cc60e7c40faffe4c8d2149d6c202fd98e796b20832bb/diff",
"MergedDir": "/var/lib/docker/overlay2/acb0b2ead431d53fa4bb06a663b3dda5274d1b9bf770e47da952173c5f574a58/merged",
"UpperDir": "/var/lib/docker/overlay2/acb0b2ead431d53fa4bb06a663b3dda5274d1b9bf770e47da952173c5f574a58/diff",
"WorkDir": "/var/lib/docker/overlay2/acb0b2ead431d53fa4bb06a663b3dda5274d1b9bf770e47da952173c5f574a58/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/home/bahadir/Documents/Projects/kosgeb-engine",
"Destination": "/opt/jboss/wildfly/bin/.niogit",
"Mode": "Z",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "050a4dceb241",
"Domainname": "",
"User": "jboss",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"8001/tcp": {},
"8080/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"JAVA_HOME=/usr/lib/jvm/java",
"WILDFLY_VERSION=19.1.0.Final",
"WILDFLY_SHA1=6883125745a62b598659ea351f5b1706aff53955",
"JBOSS_HOME=/opt/jboss/wildfly",
"LAUNCH_JBOSS_IN_BACKGROUND=true",
"JBOSS_BIND_ADDRESS=0.0.0.0",
"KIE_REPOSITORY=https://repository.jboss.org/nexus/content/groups/public-jboss",
"KIE_VERSION=7.54.0.Final",
"KIE_CLASSIFIER=wildfly19",
"KIE_CONTEXT_PATH=business-central",
"JAVA_OPTS=-Xms256m -Xmx2048m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8",
"KIE_SERVER_PROFILE=standalone"
],
"Cmd": [
"./start_business-central-wb.sh"
],
"Image": "jboss/business-central-workbench-showcase:latest",
"Volumes": null,
"WorkingDir": "/opt/jboss/wildfly/bin",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"org.label-schema.build-date": "20181205",
"org.label-schema.license": "GPLv2",
"org.label-schema.name": "CentOS Base Image",
"org.label-schema.schema-version": "1.0",
"org.label-schema.vendor": "CentOS"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "231baa83449352957b8f7b6469defbb410ae1455dd06c990f9fe75483ade72ed",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8001/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8001"
},
{
"HostIp": "::",
"HostPort": "8001"
}
],
"8080/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
},
{
"HostIp": "::",
"HostPort": "8080"
}
]
},
"SandboxKey": "/var/run/docker/netns/231baa834493",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "7e18648624c81b5f89cb7d959c7db4879cca7d5a56c16fba081112e88fceb377",
"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": "88ea0e8bc4569ba79ff1a31ec42828996a32784c7069fc7c31ef1e3cc589fc31",
"EndpointID": "7e18648624c81b5f89cb7d959c7db4879cca7d5a56c16fba081112e88fceb377",
"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
}
}
}
}
]
docker compose one says
[
{
"Id": "a332ff863902ef097abd84fc48e2a842a89e2ffbb9f9bdc6dcee3374d0a8bf49",
"Created": "2021-06-08T09:06:37.889000317Z",
"Path": "./start_business-central-wb.sh",
"Args": [],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 63252,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-06-08T09:13:17.064498858Z",
"FinishedAt": "2021-06-08T09:08:55.784957587Z"
},
"Image": "sha256:a84b58b28277164c45aaef1a44a5070e883e5ae7d1732164af6694fca9313479",
"ResolvConfPath": "/var/lib/docker/containers/a332ff863902ef097abd84fc48e2a842a89e2ffbb9f9bdc6dcee3374d0a8bf49/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/a332ff863902ef097abd84fc48e2a842a89e2ffbb9f9bdc6dcee3374d0a8bf49/hostname",
"HostsPath": "/var/lib/docker/containers/a332ff863902ef097abd84fc48e2a842a89e2ffbb9f9bdc6dcee3374d0a8bf49/hosts",
"LogPath": "/var/lib/docker/containers/a332ff863902ef097abd84fc48e2a842a89e2ffbb9f9bdc6dcee3374d0a8bf49/a332ff863902ef097abd84fc48e2a842a89e2ffbb9f9bdc6dcee3374d0a8bf49-json.log",
"Name": "/kosgeb-engine_business-central_1",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "docker-default",
"ExecIDs": null,
"HostConfig": {
"Binds": [
"/home/bahadir/Documents/Projects/kosgeb-engine/git:/opt/jboss/wildfly/bin/.niogit:Z"
],
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"8001/tcp": [
{
"HostIp": "",
"HostPort": "8001"
}
],
"8080/tcp": [
{
"HostIp": "",
"HostPort": "8080"
}
]
},
"RestartPolicy": {
"Name": "",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": [],
"CapAdd": null,
"CapDrop": null,
"CgroupnsMode": "host",
"Dns": null,
"DnsOptions": null,
"DnsSearch": null,
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"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,
"DeviceCgroupRules": null,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/a38b6370ce4a56fa04b2eba071d0229a324484a76cd84cbd9cb2f199040aba92-init/diff:/var/lib/docker/overlay2/d6e0af68bcecebe63a2084109e8ea402323b5639ad4930e3810404e1a004b1b0/diff:/var/lib/docker/overlay2/11503e1a3cbe3ccaf2a08bd53163fad56568e125c4315f8f11ed26b348c6a296/diff:/var/lib/docker/overlay2/452b79bce41d21a121fe1d517b8f41e29b63943cc880697bf78372e3e3f4dede/diff:/var/lib/docker/overlay2/6da58405868eee65c7e8fc5a96133dc3960fa02ef1e6e38fb341ca58d05d943d/diff:/var/lib/docker/overlay2/918f9536c42ee86146011fdc95cb1fa496b6c787849719c621764e178e78127e/diff:/var/lib/docker/overlay2/9bf60d043c0e84a69a321017b19a4d89ac3e242207ba00c7dc685e30d7e962bf/diff:/var/lib/docker/overlay2/ebd7aceb50c16e9d98d947efbda24518187019fc77f86d867a2f173a3a5260f0/diff:/var/lib/docker/overlay2/aa89eb5308ae3a52abe04fd56bc8485d77d31ee87098e19808dcfbf4c4bdc786/diff:/var/lib/docker/overlay2/7e65422f205cffb53ff2e8726f49c2e72392b72b4765081bae3a0a8eb3021fc6/diff:/var/lib/docker/overlay2/de58fc4c63bfefd3262d122af87c5f2ef855aa13c6b9e96ee2dfd91e54292ede/diff:/var/lib/docker/overlay2/d5cbc322dcecb6404123d32c28b00b0b8e57eb69d575f27a223a3e87975a55c0/diff:/var/lib/docker/overlay2/c83b9acd413abf540a9d00708a8d3ad7533e7a374788a0950b0f151ddb7c41d6/diff:/var/lib/docker/overlay2/5860d1bf949d13bf2fa6d8d6d0b920952096f49ea53813b6cc62c6873832d514/diff:/var/lib/docker/overlay2/4c588e89452e1b0303a5cc60e7c40faffe4c8d2149d6c202fd98e796b20832bb/diff",
"MergedDir": "/var/lib/docker/overlay2/a38b6370ce4a56fa04b2eba071d0229a324484a76cd84cbd9cb2f199040aba92/merged",
"UpperDir": "/var/lib/docker/overlay2/a38b6370ce4a56fa04b2eba071d0229a324484a76cd84cbd9cb2f199040aba92/diff",
"WorkDir": "/var/lib/docker/overlay2/a38b6370ce4a56fa04b2eba071d0229a324484a76cd84cbd9cb2f199040aba92/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "bind",
"Source": "/home/bahadir/Documents/Projects/kosgeb-engine/git",
"Destination": "/opt/jboss/wilfly/bin/.niogit",
"Mode": "Z",
"RW": true,
"Propagation": "rprivate"
}
],
"Config": {
"Hostname": "a332ff863902",
"Domainname": "",
"User": "jboss",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"8001/tcp": {},
"8080/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"JAVA_HOME=/usr/lib/jvm/java",
"WILDFLY_VERSION=19.1.0.Final",
"WILDFLY_SHA1=6883125745a62b598659ea351f5b1706aff53955",
"JBOSS_HOME=/opt/jboss/wildfly",
"LAUNCH_JBOSS_IN_BACKGROUND=true",
"JBOSS_BIND_ADDRESS=0.0.0.0",
"KIE_REPOSITORY=https://repository.jboss.org/nexus/content/groups/public-jboss",
"KIE_VERSION=7.54.0.Final",
"KIE_CLASSIFIER=wildfly19",
"KIE_CONTEXT_PATH=business-central",
"JAVA_OPTS=-Xms256m -Xmx2048m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=512m -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF-8",
"KIE_SERVER_PROFILE=standalone"
],
"Cmd": [
"./start_business-central-wb.sh"
],
"Image": "jboss/business-central-workbench-showcase:latest",
"Volumes": {
"/opt/jboss/wilfly/bin/.niogit": {}
},
"WorkingDir": "/opt/jboss/wildfly/bin",
"Entrypoint": null,
"OnBuild": null,
"Labels": {
"com.docker.compose.config-hash": "f59ac4f02be4567f3eb5c811caa332ad6515fc9d319fa5469ef6adfe4f99a5ab",
"com.docker.compose.container-number": "1",
"com.docker.compose.oneoff": "False",
"com.docker.compose.project": "kosgeb-engine",
"com.docker.compose.project.config_files": "docker-compose.yml",
"com.docker.compose.project.working_dir": "/home/bahadir/Documents/Projects/kosgeb-engine",
"com.docker.compose.service": "business-central",
"com.docker.compose.version": "1.29.2",
"org.label-schema.build-date": "20181205",
"org.label-schema.license": "GPLv2",
"org.label-schema.name": "CentOS Base Image",
"org.label-schema.schema-version": "1.0",
"org.label-schema.vendor": "CentOS"
}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "de92ff5ea51180722b17313c9225e57de2b6b61e2786a3758cdccbc911556c75",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"8001/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8001"
},
{
"HostIp": "::",
"HostPort": "8001"
}
],
"8080/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "8080"
},
{
"HostIp": "::",
"HostPort": "8080"
}
]
},
"SandboxKey": "/var/run/docker/netns/de92ff5ea511",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "f8e4ed72e4390995e34790b6a26a2c93557a71f0a9189e0b90f642dd77e2d772",
"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": "88ea0e8bc4569ba79ff1a31ec42828996a32784c7069fc7c31ef1e3cc589fc31",
"EndpointID": "f8e4ed72e4390995e34790b6a26a2c93557a71f0a9189e0b90f642dd77e2d772",
"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
}
}
}
}
]
What am I doing wrong?
You can bind volumes using long syntax like shown in here.
so your volumes should look like this:
volumes:
- type: bind
source: ./git
target: /opt/jboss/wildfly/bin/.niogit
volume:
nocopy: true
you can also take a look at this thread.
I have created a docker container for redis but I am not able to connect the same instance with a redis client.
docker command i used to bring up my redis isntance
docker run --name localredis -p 6379:6379 -d redis
please find below my docker inspect of the container
[
{
"Id": "ea6adada84602054f1057dded66c474231fcfdabcb3b0797fd82da0ff558cd6c",
"Created": "2021-01-26T16:07:13.477202002Z",
"Path": "docker-entrypoint.sh",
"Args": [
"redis-server"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 2675,
"ExitCode": 0,
"Error": "",
"StartedAt": "2021-01-26T16:07:13.834485936Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:621ceef7494adfcbe0e523593639f6625795cc0dc91a750629367a8c7b3ccebb",
"ResolvConfPath": "/var/lib/docker/containers/ea6adada84602054f1057dded66c474231fcfdabcb3b0797fd82da0ff558cd6c/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/ea6adada84602054f1057dded66c474231fcfdabcb3b0797fd82da0ff558cd6c/hostname",
"HostsPath": "/var/lib/docker/containers/ea6adada84602054f1057dded66c474231fcfdabcb3b0797fd82da0ff558cd6c/hosts",
"LogPath": "/var/lib/docker/containers/ea6adada84602054f1057dded66c474231fcfdabcb3b0797fd82da0ff558cd6c/ea6adada84602054f1057dded66c474231fcfdabcb3b0797fd82da0ff558cd6c-json.log",
"Name": "/localredis",
"RestartCount": 0,
"Driver": "overlay2",
"Platform": "linux",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": [
"66947da6a117e75cbbe696fad9e4cebd623d0209c94b63bdfb22d25ca723c074"
],
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"6379/tcp": [
{
"HostIp": "",
"HostPort": "6379"
}
]
},
"RestartPolicy": {
"Name": "no",
"MaximumRetryCount": 0
},
"AutoRemove": false,
"VolumeDriver": "",
"VolumesFrom": null,
"CapAdd": null,
"CapDrop": null,
"Capabilities": null,
"Dns": [],
"DnsOptions": [],
"DnsSearch": [],
"ExtraHosts": null,
"GroupAdd": null,
"IpcMode": "private",
"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,
"DeviceRequests": null,
"KernelMemory": 0,
"KernelMemoryTCP": 0,
"MemoryReservation": 0,
"MemorySwap": 0,
"MemorySwappiness": null,
"OomKillDisable": false,
"PidsLimit": null,
"Ulimits": null,
"CpuCount": 0,
"CpuPercent": 0,
"IOMaximumIOps": 0,
"IOMaximumBandwidth": 0,
"MaskedPaths": [
"/proc/asound",
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/f89d87a8018ce297dc6b204fff66b5da39212bc8a063be3e14fbb43813a377ad-init/diff:/var/lib/docker/overlay2/74014cbeac95ded3e80f5ec0ba64aafc252846b7c7517d5f1e00ca0ae8436e0e/diff:/var/lib/docker/overlay2/7f220239171723472e6e62802bb1f6a3341e1f3003414bb6f5f35ac8fef326a7/diff:/var/lib/docker/overlay2/5ebf1767ac29a0f344fc2134218365426f354e90e60e4ab51f09f9d571ac073f/diff:/var/lib/docker/overlay2/39eb79b70bd7680a7153eea515f4478d24733a67687a853643f87ff718566259/diff:/var/lib/docker/overlay2/6f9e7e2d91dcd0fa1f8d0ca68b600230b724c8add6bfa4102f8da12e667a5a31/diff:/var/lib/docker/overlay2/b8782f485b043e4168304f049982cb78c1039b09dae95eaed596ce61eb9ffd12/diff",
"MergedDir": "/var/lib/docker/overlay2/f89d87a8018ce297dc6b204fff66b5da39212bc8a063be3e14fbb43813a377ad/merged",
"UpperDir": "/var/lib/docker/overlay2/f89d87a8018ce297dc6b204fff66b5da39212bc8a063be3e14fbb43813a377ad/diff",
"WorkDir": "/var/lib/docker/overlay2/f89d87a8018ce297dc6b204fff66b5da39212bc8a063be3e14fbb43813a377ad/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "1bb68817383777a30df146c139e4e8d97ef7ceb3d72e2eeaba5e45bed472df05",
"Source": "/var/lib/docker/volumes/1bb68817383777a30df146c139e4e8d97ef7ceb3d72e2eeaba5e45bed472df05/_data",
"Destination": "/data",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "ea6adada8460",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"6379/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"GOSU_VERSION=1.12",
"REDIS_VERSION=6.0.10",
"REDIS_DOWNLOAD_URL=http://download.redis.io/releases/redis-6.0.10.tar.gz",
"REDIS_DOWNLOAD_SHA=79bbb894f9dceb33ca699ee3ca4a4e1228be7fb5547aeb2f99d921e86c1285bd"
],
"Cmd": [
"redis-server"
],
"Image": "redis",
"Volumes": {
"/data": {}
},
"WorkingDir": "/data",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "62f19eea272849065d5dd21104f6fa7c7e385ed9cf8fbb518c59088bc48f5fdc",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"6379/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "6379"
}
]
},
"SandboxKey": "/var/run/docker/netns/62f19eea2728",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "f0d51b78c34b598b27fef608c824974407bdf235a4d289e23f935aa87d906ef9",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "b3c2da1a7455de3deac167a7759678f293f5e9a8e886375867b7c64c30e12935",
"EndpointID": "f0d51b78c34b598b27fef608c824974407bdf235a4d289e23f935aa87d906ef9",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:03",
"DriverOpts": null
}
}
}
}
]
I am trying to add this instance as below but getting error
Any help on this would be appreciated.
I ran a Docker image. Both the container and host ports are mapped to 5000, and it can be accessed using localhost but not with the IP address. I don't have any knowledge on network systems and I'm a beginner in Docker.
I'm using Docker app for Windows, and upon docker inspect, I got this JSON:
[
{
"Id": "c38f489d712502ce57e5f6b86d8ad1efd3cf64d3c60ab3239bf34a727d0155b7",
"Created": "2020-08-19T18:17:50.917578Z",
"Path": "java",
"Args": [
"-jar",
"/app.jar"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 3142,
"ExitCode": 0,
"Error": "",
"StartedAt": "2020-08-19T18:17:53.0308405Z",
"FinishedAt": "0001-01-01T00:00:00Z"
},
"Image": "sha256:04d86c26964a44e147a0132bc6f6810f5aeba005d655b0d0b86f04499fc6a7a1",
"ResolvConfPath": "/var/lib/docker/containers/c38f489d712502ce57e5f6b86d8ad1efd3cf64d3c60ab3239bf34a727d0155b7/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/c38f489d712502ce57e5f6b86d8ad1efd3cf64d3c60ab3239bf34a727d0155b7/hostname",
"HostsPath": "/var/lib/docker/containers/c38f489d712502ce57e5f6b86d8ad1efd3cf64d3c60ab3239bf34a727d0155b7/hosts",
"LogPath": "/var/lib/docker/containers/c38f489d712502ce57e5f6b86d8ad1efd3cf64d3c60ab3239bf34a727d0155b7/c38f489d712502ce57e5f6b86d8ad1efd3cf64d3c60ab3239bf34a727d0155b7-json.log",
"Name": "/blissful_noether",
"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": "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": [
44,
168
],
"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,
"MaskedPaths": [
"/proc/acpi",
"/proc/kcore",
"/proc/keys",
"/proc/latency_stats",
"/proc/timer_list",
"/proc/timer_stats",
"/proc/sched_debug",
"/proc/scsi",
"/sys/firmware"
],
"ReadonlyPaths": [
"/proc/asound",
"/proc/bus",
"/proc/fs",
"/proc/irq",
"/proc/sys",
"/proc/sysrq-trigger"
]
},
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/49e30cda4983fa70169660522eb0264adb6a86ba7714f051ceb7fe9ba2e6f921-init/diff:/var/lib/docker/overlay2/52cc6d89b46870d8613801fc85cb6f9fa38c0b37b07857de839acd4d001b5530/diff:/var/lib/docker/overlay2/e058a1965c0dff7fbaf1f2fbbe9dbbd491f273d3389c093a3aff1a2c928e305e/diff:/var/lib/docker/overlay2/ea09144ed7206c329c5dac727f9ddd3f346260a59b9e595916f17ee11c3b6d97/diff:/var/lib/docker/overlay2/53820238bb96c5ce804cc77ecbad212bcd3bf6d6a1ca5fdcc3f4d6f4e2349007/diff",
"MergedDir": "/var/lib/docker/overlay2/49e30cda4983fa70169660522eb0264adb6a86ba7714f051ceb7fe9ba2e6f921/merged",
"UpperDir": "/var/lib/docker/overlay2/49e30cda4983fa70169660522eb0264adb6a86ba7714f051ceb7fe9ba2e6f921/diff",
"WorkDir": "/var/lib/docker/overlay2/49e30cda4983fa70169660522eb0264adb6a86ba7714f051ceb7fe9ba2e6f921/work"
},
"Name": "overlay2"
},
"Mounts": [
{
"Type": "volume",
"Name": "df1fe5e69c6437bd3e43d737b5cf7b37f9c1c5325b5505964579fd093ed4beae",
"Source": "/var/lib/docker/volumes/df1fe5e69c6437bd3e43d737b5cf7b37f9c1c5325b5505964579fd093ed4beae/_data",
"Destination": "/tmp",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "c38f489d7125",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": true,
"AttachStderr": true,
"ExposedPorts": {
"5000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-1.8-openjdk/jre/bin:/usr/lib/jvm/java-1.8-openjdk/bin",
"LANG=C.UTF-8",
"JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk",
"JAVA_VERSION=8u212",
"JAVA_ALPINE_VERSION=8.212.04-r0"
],
"Cmd": null,
"ArgsEscaped": true,
"Image": "04d86c26964a",
"Volumes": {
"/tmp": {}
},
"WorkingDir": "",
"Entrypoint": [
"java",
"-jar",
"/app.jar"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "fb790b4e2c72fc9b2c9641e1eb91aca5e74759b2ee0265ce5a1907ddb3eb1865",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"5000/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "5000"
}
]
},
"SandboxKey": "/var/run/docker/netns/fb790b4e2c72",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "0f084ea8ca77ec70d850291644523b81597b761dabe687b4e0035b4ae2e3dd56",
"Gateway": "xxx.xx.x.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "xxx.xx.x.x",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:bc:19:10:02",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "51b3be5f2161bb70042d5efd31f5b611cea241248a142f46fa612352c",
"EndpointID": "0f084ea8ca77ec70d850291644523b81597b761dabe687b45b4ae2e3dd56",
"Gateway": "xxx.xx.x.1",
"IPAddress": "xxx.xx.x.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:bc:11:00:02",
"DriverOpts": null
}
}
}
}
]
[![ipconfig][1]][1]
I even just came to know that even a Docker container consists of IP. Why is it so? Can anyone help me understand how the container can be accessed with IP?
I have tried with all the IPs available in the JSON above and ipconfig image, but it does not work.
Yes, Docker containers have their Unique IP address(more in Kubernetes).
https://stackoverflow.com/a/43694284/9650284
refer this for an explanation(comments on the solutions). TLDR it is not possible to access the internal IP of the docker container from your host.
I have a docker container named some-mysql, attacched to an overlay network named mynet: when i do docker inspect some-mysql it shows me this huge JSON:
{
"Id": "49cb39a4e8e5e7421a4ae69ffd5bb17a8f90f02abbfc3f64ef80d206ceb11c1f",
"Created": "2017-02-24T09:21:50.237425126Z",
"Path": "docker-entrypoint.sh",
"Args": [
"mysqld"
],
"State": {
"Status": "running",
"Running": true,
"Paused": false,
"Restarting": false,
"OOMKilled": false,
"Dead": false,
"Pid": 28706,
"ExitCode": 0,
"Error": "",
"StartedAt": "2017-03-27T06:59:40.137554407Z",
"FinishedAt": "2017-03-25T00:05:46.938307695Z"
},
"Image": "sha256:7666f75adb6b50676a366c6fd7a3916cb41f6e8eaf336c3d3ab7d35317fed0b9",
"ResolvConfPath": "/var/lib/docker/containers/49cb39a4e8e5e7421a4ae69ffd5bb17a8f90f02abbfc3f64ef80d206ceb11c1f/resolv.conf",
"HostnamePath": "/var/lib/docker/containers/49cb39a4e8e5e7421a4ae69ffd5bb17a8f90f02abbfc3f64ef80d206ceb11c1f/hostname",
"HostsPath": "/var/lib/docker/containers/49cb39a4e8e5e7421a4ae69ffd5bb17a8f90f02abbfc3f64ef80d206ceb11c1f/hosts",
"LogPath": "/var/lib/docker/containers/49cb39a4e8e5e7421a4ae69ffd5bb17a8f90f02abbfc3f64ef80d206ceb11c1f/49cb39a4e8e5e7421a4ae69ffd5bb17a8f90f02abbfc3f64ef80d206ceb11c1f-json.log",
"Name": "/some-mysql",
"RestartCount": 0,
"Driver": "aufs",
"MountLabel": "",
"ProcessLabel": "",
"AppArmorProfile": "",
"ExecIDs": null,
"HostConfig": {
"Binds": null,
"ContainerIDFile": "",
"LogConfig": {
"Type": "json-file",
"Config": {}
},
"NetworkMode": "default",
"PortBindings": {
"3306/tcp": [
{
"HostIp": "",
"HostPort": "3307"
}
]
},
"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": "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": "aufs",
"Data": null
},
"Mounts": [
{
"Type": "volume",
"Name": "c709191cb719b447772bde814f490eb2b30429c9ca7f1c62fda445af9e0b5fb9",
"Source": "/var/lib/docker/volumes/c709191cb719b447772bde814f490eb2b30429c9ca7f1c62fda445af9e0b5fb9/_data",
"Destination": "/var/lib/mysql",
"Driver": "local",
"Mode": "",
"RW": true,
"Propagation": ""
}
],
"Config": {
"Hostname": "49cb39a4e8e5",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3306/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"MYSQL_ROOT_PASSWORD=pass",
"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.17-1debian8"
],
"Cmd": [
"mysqld"
],
"ArgsEscaped": true,
"Image": "mysql",
"Volumes": {
"/var/lib/mysql": {}
},
"WorkingDir": "",
"Entrypoint": [
"docker-entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"NetworkSettings": {
"Bridge": "",
"SandboxID": "1f5cde48c303e649f0b675ac11f302336936c7ea0f7c1a0ea8054866c308189d",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"3306/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "3307"
}
]
},
"SandboxKey": "/var/run/docker/netns/1f5cde48c303",
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"EndpointID": "2800343c29643796d28e8f58a13a7dbf5d1a2706d26f25e27ea623a4673d4439",
"Gateway": "172.17.0.1",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"MacAddress": "02:42:ac:11:00:03",
"Networks": {
"bridge": {
"IPAMConfig": null,
"Links": null,
"Aliases": null,
"NetworkID": "a3ec63c75685ca69af892f7047abc2c1d0955407d61423f2cff87500eedaadf3",
"EndpointID": "2800343c29643796d28e8f58a13a7dbf5d1a2706d26f25e27ea623a4673d4439",
"Gateway": "172.17.0.1",
"IPAddress": "172.17.0.3",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:11:00:03"
},
"mynet": {
"IPAMConfig": {},
"Links": null,
"Aliases": [
"49cb39a4e8e5"
],
"NetworkID": "37af7ae0184078932bbc234c1f4b15983777f566c36f7eb93e2b4b3437e460a7",
"EndpointID": "fd1f776954723a705edef323b63588cfc93cca7b80b15f22414b72454e14e48c",
"Gateway": "172.18.0.1",
"IPAddress": "172.18.0.2",
"IPPrefixLen": 16,
"IPv6Gateway": "",
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"MacAddress": "02:42:ac:12:00:02"
}
}
}
}
]
My goal is to get only IP address of some-mysql container related to network interface mynet. If I do
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' some-mysql
I get: 172.17.0.3172.18.0.2 : they are IP addresses of default bridge network and my overlay network. How can i retrieve only some-mysql IP address of mynet interface?
You can specify the network name, without needing of range:
docker inspect -f '{{.NetworkSettings.Networks.mynet.IPAddress}}' some-mysql