Subject: Sporadic, unpredictable docker / docker-compose (on Alpine 3.13) issues with DNS name resolution

From: Banibrata Dutta <[email-masked]>
Date: Thu, 4 Mar 2021 02:41:08 +0530

Hi Folks,

Have been using docker and docker-compose inside Virtualbox VMs running
Alpine 3.13 guestOS, on a Windows 10 Professional host. The Alpine Guest
has 2 vCPUs, 4GB vRAM, and even when all containers are running the RAM
usage remains below 1GB.

   - Docker version 20.10.3, build 48d30b5b32e99c932b4ea3edca74353feddd83ff
   - docker-compose version 1.27.4, build unknown

I use 2 docker-compose .yml files to bring up, 2 set of containers. First
.yml file brings up Telgraf, InfluxDB, Grafana containers based on images
from DockerHub. The second .yml brings up a POJO-server (Java) with
application and another 3 tester/simulators.They all share a dedicated
network ‘mynet’ (using bridged driver). The above setup seems to work
perfectly at times. For example:

   -

   Sometimes , containers don’t seem to get hostname assigned (i.e. the
   mnemonic container-id is set as hostname, as is default) while at other
   times specific hostname is indeed assigned.
   -

   Then, for a few containers (not all), the inter-container DNS/name
   resolution doesn’t seem to work, but at the same time few other containers
   have perfectly working inter-container DNS/name resolution. When
   inter-container DNS resolution does-not, if I log into the container
   runtime using ‘docker exec -it bash’, and try to do 'ping ', I get the
   following error:
   *ping: somehostname: Temporary failure in name resolution*
   -

   Sometimes, some containers (not all) require the "service: > hostname: "
   declaration in the docker-compose .yml file to get specific hostname
   assigned to the container, but for other containers at other times, that
   declaration is not needed, and only the “container_name” declaration is
   enough (in .yml file) to have specific hostname for that container !!

Wondering if anyone can help figure out why is the behaviour erratic ? What
can I do to fix it ? Is this an issue with Docker only on Alpine ?

Thanks in anticipation.
regards,
BD

---

From: Paul Suh <[email-masked]>
Date: Thu, 4 Mar 2021 01:26:21 +0000

I just ran into this as well. I’m not using it for production so I wasn’t worried about it until I saw this email. Restarting the docker daemon seemed to fix things. I hadn’t used my Docker system for a almost year (working on other projects) and didn’t see this problem back then. 

My docker system is:
Alpine 3.12.4
Docker version 20.10.3, build 48d30b5b32e99c932b4ea3edca74353feddd83ff
docker-compose version 1.25.4, build unknown 

Running as a qemu guest on Proxmox 6.3-4, 1.11 GB RAM used of 16 GB allocated, 4 vCPUs available. 570 MB used out of a 16 GB boot disk. Docker images and containers are stored on an iSCSI mount coming from a FreeNAS server hosted on the same hardware. 

Underlying hardware is a SuperMicro X11SDV-4C-TLN2F Server Motherboard - Intel Xeon D-2123IT Quad-core (4 Core) 2.20 GHz, 64 GB RAM, LSI 9207-8i HBA, 8 x 4 GB Ironwolf drives, 3 x Samsung 860 EVO 250 GB SSD, 1 x Samsung EVO 860 500 GB SSD. 

Is it worth filing a bug? And where should the bug be filed? 

—Paul

> 
> On Mar 3, 2021, at 4:11 PM, Banibrata Dutta <[email-masked]> wrote:
> 
> Hi Folks,
> 
> Have been using docker and docker-compose inside Virtualbox VMs running Alpine 3.13 guestOS, on a Windows 10 Professional host. The Alpine Guest has 2 vCPUs, 4GB vRAM, and even when all containers are running the RAM usage remains below 1GB.
> 
> 	• Docker version 20.10.3, build 48d30b5b32e99c932b4ea3edca74353feddd83ff
> 	• docker-compose version 1.27.4, build unknown
> I use 2 docker-compose .yml files to bring up, 2 set of containers. First .yml file brings up Telgraf, InfluxDB, Grafana containers based on images from DockerHub. The second .yml brings up a POJO-server (Java) with application and another 3 tester/simulators.They all share a dedicated network ‘mynet’ (using bridged driver). The above setup seems to work perfectly at times. For example:
> 
> 	• Sometimes , containers don’t seem to get hostname assigned (i.e. the mnemonic container-id is set as hostname, as is default) while at other times specific hostname is indeed assigned.
> 
> 	• Then, for a few containers (not all), the inter-container DNS/name resolution doesn’t seem to work, but at the same time few other containers have perfectly working inter-container DNS/name resolution. When inter-container DNS resolution does-not, if I log into the container runtime using ‘docker exec -it bash’, and try to do 'ping ', I get the following error:
> ping: somehostname: Temporary failure in name resolution
> 
> 	• Sometimes, some containers (not all) require the "service: > hostname: " declaration in the docker-compose .yml file to get specific hostname assigned to the container, but for other containers at other times, that declaration is not needed, and only the “container_name” declaration is enough (in .yml file) to have specific hostname for that container !!
> 
> Wondering if anyone can help figure out why is the behaviour erratic ? What can I do to fix it ? Is this an issue with Docker only on Alpine ?
> 
> Thanks in anticipation.
> 
> regards,
> BD

---

From: Banibrata Dutta <[email-masked]>
Date: Thu, 4 Mar 2021 17:25:11 +0530

On Thu, Mar 4, 2021 at 6:56 AM Paul Suh <[email-masked]> wrote:

> I just ran into this as well. I’m not using it for production so I wasn’t
> worried about it until I saw this email. Restarting the docker daemon
> seemed to fix things. I hadn’t used my Docker system for a almost year
> (working on other projects) and didn’t see this problem back then.
>
> My docker system is:
> Alpine 3.12.4
> Running as a qemu guest on Proxmox 6.3-4, 1.11 GB RAM used of 16 GB
> allocated, 4 vCPUs available. 570 MB used out of a 16 GB boot disk. Docker
> images and containers are stored on an iSCSI mount coming from a FreeNAS
> server hosted on the same hardware.
>
> Underlying hardware is a SuperMicro X11SDV-4C-TLN2F Server Motherboard -
> Intel Xeon D-2123IT Quad-core (4 Core) 2.20 GHz, 64 GB RAM, LSI 9207-8i
> HBA, 8 x 4 GB Ironwolf drives, 3 x Samsung 860 EVO 250 GB SSD, 1 x Samsung
> EVO 860 500 GB SSD.
>

Thanks for the reply. In my case I've tried several things, which do not
help consistently:
- Restarting docker daemon
- Restarting the VM
- Ensuring the Virtualbox SW is latest on the host system

Only thing that I'm yet to do is to reinstall docker and docker-compose. I
was a bit wary of doing that, but might as well try it.

Possibly. If our issues are indeed similar, either of us can create a bug
reporrt, and other person can upvote it. Need to figure out how to report
bugs on Alpine.

> > I use 2 docker-compose .yml files to bring up, 2 set of containers.
> First .yml file brings up Telgraf, InfluxDB, Grafana containers based on
> images from DockerHub. The second .yml brings up a POJO-server (Java) with
> >       • Sometimes , containers don’t seem to get hostname assigned (i.e.
> the mnemonic container-id is set as hostname, as is default) while at other
> >       • Then, for a few containers (not all), the inter-container
> DNS/name resolution doesn’t seem to work, but at the same time few other
> containers have perfectly working inter-container DNS/name resolution. When
> >       • Sometimes, some containers (not all) require the "service: >
> hostname: " declaration in the docker-compose .yml file to get specific
> hostname assigned to the container, but for other containers at other
> times, that declaration is not needed, and only the “container_name”
> declaration is enough (in .yml file) to have specific hostname for that
> container !!
> >
> > Wondering if anyone can help figure out why is the behaviour erratic ?
> What can I do to fix it ? Is this an issue with Docker only on Alpine ?
> >
> > Thanks in anticipation.
> >
>
>