busybox icon indicating copy to clipboard operation
busybox copied to clipboard

Switch :latest to glibc to address DNS lookup problems

Open ustaerk opened this issue 4 years ago • 5 comments

Hi there,

#18 still is an issue as DNS lookup still seems to be broken in the uclib version of upstream (see below). As the Prometheus images are based on prom/busybox:latest they are based on the broken uclib version of upstream as well, causing issues with service discovery in docker compose setups. Is there any chance you could switch to the glibc version for :latest instead of uclib?

docker-compose.yml:

version: "3.8"
services:
  one:
    image: quay.io/prometheus/busybox:latest
    networks:
      - test-net
    entrypoint: sh
    command:
      - -c
      - while sleep 2; do nslookup two; echo XXXXXXXXXXXXX; done
  two:
    image: quay.io/prometheus/busybox:glibc
    networks:
      - test-net
    entrypoint: sh
    command:
      - -c
      - while sleep 2; do nslookup one; echo XXXXXXXXXXXXX; done
networks:
  test-net:

Sample output:

test-one-1  | Server:		127.0.0.11
test-one-1  | Address:	127.0.0.11:53
test-one-1  | 
test-one-1  | Non-authoritative answer:
test-one-1  | 
test-one-1  | *** Can't find two: No answer
test-one-1  | 
test-one-1  | XXXXXXXXXXXXX
test-two-1  | Server:		127.0.0.11
test-two-1  | Address:	127.0.0.11:53
test-two-1  | 
test-two-1  | Non-authoritative answer:
test-two-1  | Name:	one
test-two-1  | Address: 172.24.0.2
test-two-1  | 
test-two-1  | Non-authoritative answer:
test-two-1  | 
test-two-1  | XXXXXXXXXXXXX

ustaerk avatar Jan 06 '22 13:01 ustaerk

Any updates?

axd1x8a avatar Oct 01 '24 21:10 axd1x8a

I was following the prometheus getting started tutorial with docker compose so I could document how prometheus and its targets were setup as separate services instead of having to manually run many individual processes. Unfortunately that led me to discover this issue where DNS wasn't working between the services. :(

dyllandry avatar Nov 06 '25 21:11 dyllandry

I wish uclib/busybox would just fix this.. But I'd be ok with switching this. @SuperQ wdyt?

discordianfish avatar Nov 12 '25 10:11 discordianfish

I'm not sure exactly why we really care about this. All Prometheus components use Go for DNS lookups, they don't actually use uclibc/glibc. The only thing here is the Busybox, which is only really there for /bin/sh and basic tools.

SuperQ avatar Nov 12 '25 11:11 SuperQ

I mean tbh I don't care that much either way. But I feel slightly we should either have a complete distroless image or something where the basic tools are working and not causing people to use them for things that then break and cause them to open issues here :)

discordianfish avatar Nov 12 '25 16:11 discordianfish