mDNS packets capture and advertisement inside docker container in GitHub CI - docker

How to see mDNS packets and advertise some mDNS services from docker container to GitHub CI nodes

Related

Cannot catch packets in docker container with tcpdump

Recently I was encounter an issue with packets lost and we were trying to catch packets inside container. Application is running on docker swarm as a service on port 3000.
After tcpdump installation, I was able to run the command but I find out I am not able to catch packets inside the container with destination port 3000 - port of the app.
tcpdump port 3000
I found the blog from Akita that describe how to connect to the container network (I used nicolaka/netshoot image). When I tested it locally with docker container (not services) it works but in swarm it did not. I was able to catch other packets, e.g. to PG database.
Can somebody explain why it does not work? Does the network on swarm containers deployed as a service works differently?

Not able to connect docker container from remote(PING)

Created Mongo db container on cloud and tested successfully ping from cloud to docker container.
But unable to ping docker container from the remote machine.
On the cloud firewall ICMP protocol is allowed for all IPV4 addresses. But still, ping is not working from remote machine to docker container.
Does this require any additional configuration in docker container?

How to access a docker container on host from local VM?

I have a docker container set up on the host with RabbitMQ installed and I'm trying to connect to that container and access the RMQ web UI from a Hyper-V VM. The docker container has a static ip assigned and is connected to a transparent network adapter while the VM is connected to an ethernet network adapter. I am new to networking so I have no idea how to connect the VM to the container. I've tried docker swarm but that gave me a deadline exceeded error so now I'm exploring port forwarding with the docker container or configure the VM to use bridged network mode, both of which I have no experience in. Pinging the docker container from host succeeds and so does pinging the host from VM but not the other way around. Some help would be appreciated.

By default, can a docker container call host's localhost UDP?

I have a docker container, and also installed on the VM a daemon listening for UDP on port 8125. The container sends data with UDP protocol on this 8125 port.
I was trying to open the port by starting the container with the -p 8125:8125/udp, but I'm getting the following error:
Error starting userland proxy: listen udp 0.0.0.0:8125: bind: address already in use
Which makes sense because the daemon is already listening on this port.
So how can I configure Docker so that the container can send UDP payloads to the external daemon ?
Opening ports is only needed when you want to Listen for the requests not sending. By default Docker provides the necessary network namespace for your container to communicate to the host or outside world.
So, you could it in two ways:
use --net host in your docker run and send requests to localhost:8125 in this case you containerized app is effectively sharing the host's network stack. So localhost points to the daemon that's already running in your host.
talk to the container network gateway (which is usually 172.17.0.1) or your host's hostname from your container. Then your are able to send packets to your daemon in your host.

How does Docker Swarm start a container

For Docker Swarm, the Swarm manager runs on master node while swarm agent runs on slave node. I’m interested in the steps of starting a container. There are two options:
Swarm manager starts containers directly through Docker remote API.
Swarm manager asks Swarm agent to start container, then Swarm agent ask local Docker daemon to start container.
Personally, I think the first one is right. But I’m not sure...
Swarm agents don't have access to the Docker daemon, they are only there to communicate via etcd, consul or zookeeper with the master. So the first one is correct. They agent registers the host with the discovery service and from then on the manager can access it via the daemon listening on a TCP port.

Resources