Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local project connecting to dockerized cote services on macOS #107

Closed
rankun203 opened this issue Jul 26, 2018 · 1 comment
Closed

Local project connecting to dockerized cote services on macOS #107

rankun203 opened this issue Jul 26, 2018 · 1 comment
Labels

Comments

@rankun203
Copy link

rankun203 commented Jul 26, 2018

Issue: Both services cannot talk to each other.

  • Local developing project: Our current project is running using VS Code's run script, a normal script.
  • Dockerized cote service: Some of our services are just plain docker containers that are already running locally, we are now trying to connect to them.
  • macOS: We are using Docker for Mac, with docker-compose.

Tried solutions:

  • Using network_mode: host on docker-compose services, did not work.
  • privileged: true, did not work.
Click to see the complete docker inspect service_container output.

[
    {
        "Id": "adad553a9c14995bd28beb6d88c867b66ecfb4b8eddaba1b28b9b826307cf1b9",
        "Created": "2018-07-26T07:48:30.0823891Z",
        "Path": "node",
        "Args": [
            "lib/index.js"
        ],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 14116,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2018-07-26T07:48:30.4596792Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:9fae10e0b5e1021c9fa477e7cc874a30e9a2c6557523ade11a05cd6811147c82",
        "ResolvConfPath": "/var/lib/docker/containers/adad553a9c14995bd28beb6d88c867b66ecfb4b8eddaba1b28b9b826307cf1b9/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/adad553a9c14995bd28beb6d88c867b66ecfb4b8eddaba1b28b9b826307cf1b9/hostname",
        "HostsPath": "/var/lib/docker/containers/adad553a9c14995bd28beb6d88c867b66ecfb4b8eddaba1b28b9b826307cf1b9/hosts",
        "LogPath": "/var/lib/docker/containers/adad553a9c14995bd28beb6d88c867b66ecfb4b8eddaba1b28b9b826307cf1b9/adad553a9c14995bd28beb6d88c867b66ecfb4b8eddaba1b28b9b826307cf1b9-json.log",
        "Name": "/ls-lstack-server-example-cms_ms-messaging_1",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [],
            "ContainerIDFile": "",
            "LogConfig": {
                "Type": "json-file",
                "Config": {}
            },
            "NetworkMode": "host",
            "PortBindings": {},
            "RestartPolicy": {
                "Name": "always",
                "MaximumRetryCount": 0
            },
            "AutoRemove": false,
            "VolumeDriver": "",
            "VolumesFrom": [],
            "CapAdd": null,
            "CapDrop": null,
            "Dns": null,
            "DnsOptions": null,
            "DnsSearch": null,
            "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": null,
            "BlkioDeviceReadBps": null,
            "BlkioDeviceWriteBps": null,
            "BlkioDeviceReadIOps": null,
            "BlkioDeviceWriteIOps": null,
            "CpuPeriod": 0,
            "CpuQuota": 0,
            "CpuRealtimePeriod": 0,
            "CpuRealtimeRuntime": 0,
            "CpusetCpus": "",
            "CpusetMems": "",
            "Devices": null,
            "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/17ac561937a5fd47b8bc6ccf54b2f076843d7dbe3921f2eab018a10b33458122-init/diff:/var/lib/docker/overlay2/3f4f6cfdeb11214065f4694e674c67bf0055dc7d88a449a5e18102e5e178278b/diff:/var/lib/docker/overlay2/620a31340f255cc0e79bb8214f0289563259e17b110201f9fa36f241ac0279f2/diff:/var/lib/docker/overlay2/4be1c84b70cde1f1704ec3668dcc0bb9311608a9afdac6e2bf09d51c859e4d57/diff:/var/lib/docker/overlay2/ff9d5d49b5a9a2b5983de27c975191cadc421c1d79155f20e0f467ff2476ac02/diff:/var/lib/docker/overlay2/cbe411cf0de6b847faa3e234fac796e673e1797b32656477b2b025dd29950e64/diff:/var/lib/docker/overlay2/ddfff1344eeced511f3ad787bace0fce2789daf531ebe2284a4665c5c0773d76/diff:/var/lib/docker/overlay2/5cc3f6fc7f4b12e61a8e36218a312b9ddb710b9fee069b41d4e3bd47bb8c8032/diff:/var/lib/docker/overlay2/c221406df4b85883fbb9b37df5baa14ff478693473db421dc62733e91c773eda/diff:/var/lib/docker/overlay2/08f6e6ba2101a2af936e836c98d1f964f466b7d1ee02add8c7bcb82a7b1c0bbd/diff:/var/lib/docker/overlay2/03753cfa96868f593f654d2f091f6ace4291f025a26f1575d629f5b6bb4f6b7e/diff:/var/lib/docker/overlay2/511aa68ec07154f27f83d89982c63219432da53a81574aa0447739f939218955/diff",
                "MergedDir": "/var/lib/docker/overlay2/17ac561937a5fd47b8bc6ccf54b2f076843d7dbe3921f2eab018a10b33458122/merged",
                "UpperDir": "/var/lib/docker/overlay2/17ac561937a5fd47b8bc6ccf54b2f076843d7dbe3921f2eab018a10b33458122/diff",
                "WorkDir": "/var/lib/docker/overlay2/17ac561937a5fd47b8bc6ccf54b2f076843d7dbe3921f2eab018a10b33458122/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [],
        "Config": {
            "Hostname": "linuxkit-025000000001",
            "Domainname": "",
            "User": "",
            "AttachStdin": false,
            "AttachStdout": false,
            "AttachStderr": false,
            "ExposedPorts": {
                "8000/tcp": {}
            },
            "Tty": false,
            "OpenStdin": false,
            "StdinOnce": false,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
                "NODE_VERSION=10.7.0",
                "YARN_VERSION=1.7.0"
            ],
            "Cmd": null,
            "ArgsEscaped": true,
            "Image": "registry.lodestreams.com/lodestream/lstack-server-ms-messaging:latest",
            "Volumes": null,
            "WorkingDir": "/app",
            "Entrypoint": [
                "node",
                "lib/index.js"
            ],
            "OnBuild": null,
            "Labels": {
                "com.docker.compose.config-hash": "5cecfc2bda993d81ec36529b9d0782bdcb0d2b4d507d4793d0a6d41e372c5ab5",
                "com.docker.compose.container-number": "1",
                "com.docker.compose.oneoff": "False",
                "com.docker.compose.project": "ls-lstack-server-example-cms",
                "com.docker.compose.service": "ms-messaging",
                "com.docker.compose.version": "1.21.1"
            }
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "d70ff818c6c456697012e0c0dad6d85f3284342445a475bd4d284be03ec17496",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/default",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "",
            "Gateway": "",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "",
            "IPPrefixLen": 0,
            "IPv6Gateway": "",
            "MacAddress": "",
            "Networks": {
                "host": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "f3021ae8c63a0ec5ff3debd6057186dcf5f054cfcb7b83648075be695d5a165f",
                    "EndpointID": "920ef1af79f55a98c47bfb0b733625c2d7805bf0aadc1d6c42053b0693a94bd6",
                    "Gateway": "",
                    "IPAddress": "",
                    "IPPrefixLen": 0,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "",
                    "DriverOpts": null
                }
            }
        }
    }
]

@rankun203 rankun203 changed the title Local developing project connecting to dockerized cote services on macOS Local project connecting to dockerized cote services on macOS Jul 26, 2018
@rankun203
Copy link
Author

Verified, on Linux, network_mode: host will just do the work.

On Mac however, it won't work, see this issue (docker/for-mac#1031).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants