0

So, I have docker desktop for Windows and in that I am running a linux container. On this linux container, I have Gstreamer-Daemon installed.This Gstreamer Daemon by default runs on the port 5000 of the machine on which it is called.

Gstreamer-Daemon github source Repo:

https://github.com/RidgeRun/gstd-1.x

In the https://github.com/RidgeRun/gstd-1.x/tree/master/libgstc/pygstc python examples given here,gstc.py represents a Gstreamer-Client that connects to the Gstreamer Daemon via TCP socket.So, this "gstc.py" abstracts out the Inter-Process communication between itself and the Gstreamer daemon by providing some set of function calls.

So, I have created a dummy python code "tut1.py" which Instantiates the object of GstdClient in "gstc.py" and connects to the Gstreamer-daemon server, by having provided ip and port in it's constructor.And then it pings the Gstreamer daemon server.It returns True, if Gstreamer daemon responds on given ip and port.

The code for "tut1.py" is

from gstc import GstdClient
gc=GstdClient(ip="127.0.0.1",port=5000)
print (gc.ping_gstd())

So, this returns true, when this tut1.py is running on the same host on which the Gstreamer daemon is running. Returns True when tut1.py runs on same host machine as Gstd

Now I run the docker container and publish the port 5000 to the host port 5000.

docker run -it -p 5000:5000 mydev2:18.04

But then now when I start the Gstreamer daemon on the container and run the "tut1.py" from cmd line in Windows to connect to Gstreamer daemon on linux container, it seems to go into some infinite loop and doesn't return.

Left is windows command prompt and right is linux container.

Please help me find out where I am going wrong.

Here is the dump of docker inspect command for the container

[
    {
        "Id": "1536252fb13b9bc60a501091d9d24eed8738561ecf4ea64ea49ca710cd195f8a",
        "Created": "2020-05-21T11:57:07.784714698Z",
        "Path": "/bin/bash",
        "Args": [],
        "State": {
            "Status": "running",
            "Running": true,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 1998,
            "ExitCode": 0,
            "Error": "",
            "StartedAt": "2020-05-21T11:57:09.172136556Z",
            "FinishedAt": "0001-01-01T00:00:00Z"
        },
        "Image": "sha256:1b2cad808546b84c06568c6d5d41a0886b135b407d786f4a0b51bdc7d2255861",
        "ResolvConfPath": "/var/lib/docker/containers/1536252fb13b9bc60a501091d9d24eed8738561ecf4ea64ea49ca710cd195f8a/resolv.conf",
        "HostnamePath": "/var/lib/docker/containers/1536252fb13b9bc60a501091d9d24eed8738561ecf4ea64ea49ca710cd195f8a/hostname",
        "HostsPath": "/var/lib/docker/containers/1536252fb13b9bc60a501091d9d24eed8738561ecf4ea64ea49ca710cd195f8a/hosts",
        "LogPath": "/var/lib/docker/containers/1536252fb13b9bc60a501091d9d24eed8738561ecf4ea64ea49ca710cd195f8a/1536252fb13b9bc60a501091d9d24eed8738561ecf4ea64ea49ca710cd195f8a-json.log",
        "Name": "/nifty_hopper",
        "RestartCount": 0,
        "Driver": "overlay2",
        "Platform": "linux",
        "MountLabel": "",
        "ProcessLabel": "",
        "AppArmorProfile": "",
        "ExecIDs": null,
        "HostConfig": {
            "Binds": [
                "/c/Aayush25:/home/"
            ],
            "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,
            "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": [
                25,
                103
            ],
            "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/85304d12b1ce2548b35a59e4653f9bb14a322ad932cd1536854451a87aeb23a9-init/diff:/var/lib/docker/overlay2/9df6e455bf97ae2be9fefd42de475433a393d14c4542a1c2e265ba5caae6f554/diff:/var/lib/docker/overlay2/727ea9d944ab97716315c4f42dc9c722d060785558e84931fdda91bb85314037/diff:/var/lib/docker/overlay2/d147eab2d25ea9e5d01f81573a0d2549f7375ccdcdb2762a2ccf906675a0f692/diff:/var/lib/docker/overlay2/5413fc7ca85e1af5624f7a88ca6892b70e77879bb0d2a0cb2937085f32fcdf21/diff:/var/lib/docker/overlay2/568a6e71d2860579d2c3440afd0cfcabcfd88beec7b24711038a327ad3882fb4/diff:/var/lib/docker/overlay2/d9f4c3eec9a219eb2e99b4311832143c822a3c8cb701b8bfb396d04830a18a27/diff:/var/lib/docker/overlay2/5f73547837bce176a8d105e07dcedadd788bc1a99cd7662fcbdb62c0fedef24a/diff:/var/lib/docker/overlay2/5cb83bab3e88dc023e6daf0fce5d3da3280f4dff6cfb4e96306dd3f4364955fa/diff",
                "MergedDir": "/var/lib/docker/overlay2/85304d12b1ce2548b35a59e4653f9bb14a322ad932cd1536854451a87aeb23a9/merged",
                "UpperDir": "/var/lib/docker/overlay2/85304d12b1ce2548b35a59e4653f9bb14a322ad932cd1536854451a87aeb23a9/diff",
                "WorkDir": "/var/lib/docker/overlay2/85304d12b1ce2548b35a59e4653f9bb14a322ad932cd1536854451a87aeb23a9/work"
            },
            "Name": "overlay2"
        },
        "Mounts": [
            {
                "Type": "bind",
                "Source": "/c/Aayush25",
                "Destination": "/home",
                "Mode": "",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],
        "Config": {
            "Hostname": "1536252fb13b",
            "Domainname": "",
            "User": "",
            "AttachStdin": true,
            "AttachStdout": true,
            "AttachStderr": true,
            "ExposedPorts": {
                "5000/tcp": {},
                "8088/tcp": {}
            },
            "Tty": true,
            "OpenStdin": true,
            "StdinOnce": true,
            "Env": [
                "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
            ],
            "Cmd": [
                "/bin/bash"
            ],
            "Image": "mydev2:18.04",
            "Volumes": null,
            "WorkingDir": "",
            "Entrypoint": null,
            "OnBuild": null,
            "Labels": {}
        },
        "NetworkSettings": {
            "Bridge": "",
            "SandboxID": "edd3e6401e26907de34a81976e1ff5bb546a0dec864c98213c3b3cff09a14b92",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "5000/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "5000"
                    }
                ],
                "8088/tcp": null
            },
            "SandboxKey": "/var/run/docker/netns/edd3e6401e26",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "4b615e97c6a43afb239cd4853be74a238214d46311ba929f52873afd22d45447",
            "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": "ff2eda2dd942ce383e08f33268ef5cc97df2f9b504f5fdc4bbe593c09f904ffd",
                    "EndpointID": "4b615e97c6a43afb239cd4853be74a238214d46311ba929f52873afd22d45447",
                    "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
                }
            }
        }
    }
]

Btw, I also tried by connecting to 172.17.0.2:5000, 172.17.0.1:5000, but that also didn't work and they both returned false.

0 Answers0