Network connection timeout when docker container is running

Hi,

I installed my first pihole on a Raspberry Pi 4 running the latest Raspberry Pi OS & docker.

The docker container is created using the below command:

sudo docker run --restart always --hostname pihole -p 53:53/udp -p 53:53 -p 443:443 -p 67:67/udp -p 81:80 pihole/pihole

Pihole is running well but the performance is sluggish. So, I did a continuous ping from a Windows laptop to the Raspberry Pi (with a static IP & connected via network cable to my WiFi router).

The request timeout was quite bad at around 13% within just a few minutes, causing the SSH to the Raspberry Pi is sluggish.

When I stopped the docker container, the continuous ping from the same Windows laptop is perfect & without a single packet loss. Later, I isolated the issue down to when any docker container is running, the issue surfaces. I can easily reproduce this issue with hoobs/hoobs & portainer/portainer images.

What could I have done wrong with the set up?

Details of the setup:
PRETTY_NAME=“Raspbian GNU/Linux 10 (buster)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“10”
VERSION=“10 (buster)”
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian

Linux raspberrypi 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

Client: Docker Engine - Community
Version: 19.03.11
API version: 1.40
Go version: go1.13.10
Git commit: 42e35e6
Built: Mon Jun 1 09:20:15 2020
OS/Arch: linux/arm
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.11
API version: 1.40 (minimum version 1.12)
Go version: go1.13.10
Git commit: 42e35e6
Built: Mon Jun 1 09:14:09 2020
OS/Arch: linux/arm
Experimental: false
containerd:
Version: 1.2.13
GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683

All docker images (pihole/pihole, hoobs/hoobs, portainer/portainer) are from the latest tag.
All the mentioned docker images/containers are exhibiting the same issue when run with even the most basic command - sudo docker run dockerimagename (eg: sudo docker run pihole/pihole)

Have you been able to solve the problem? I seem to be having the same issue with docker on raspbian