Docker Community Forums

Share and learn in the Docker community.

Docker compose network having external IP on Android hotspot or any psysical LAN + avahi hostname sort off

Hi,

I am trying to write a docker-compose that provides DoT service for Android devices for private DNS.

The goal is to have my defined IP addresses mapped to a certain domain like using /etc/hosts shared on the Android device/s.
However assuming I will have a laptop and Android device, the Android device will provide a hotspot aka VLAN network.

Requirements:

  • No swarm :slight_smile:
  • docker-compose to be used

First, what I want is to bridge the network of the docker-compose file as a separate IP address attached to the hotspot of the Android device. Where the docker host network will not be interrupted by the DNS server, I tried exposing Pihole as service with this setup:

networks:
ultranetwork:
external: true
outside:
driver: bridge
ipam:
driver: default
config:
- subnet: 192.168.43.0/24

then this inside the Pihole’s service:

networks:
ultranetwork: {
ipv4_address: 192.168.43.21
}

The result was the laptop didn’t want to resolve any domain using my browser or curl, when I removed the network by hand in shell, the IP routing was fixed.

Second, is it possible to set Avahi/Bonjour or whatever protocol that broadcasts hostname on the VLAN aka the Android’s hotspot. Because private DNS on Android requires FQN instead of the traditional DNS having only an IP.
Usually, if you have a host named bob it can be accessed by any computer in the LAN as bob.local, can the container be accessed like “pihole.local” if we successfully expose the container or docker-compose network as separate bridged network with own IP on the LAN?