alpinelinux / docker-alpine

Official Alpine Linux Docker image. Win at minimalism!
MIT License
1.08k stars 262 forks source link

10% DNS Failures with Alpine 3.19 or 3.20 #417

Open richardtearle-nps opened 3 weeks ago

richardtearle-nps commented 3 weeks ago

We are having trouble with DNS lookups when using Alpine 3.19 or 3.20 images when using podman on Oracle Linux 8. Our actual application is Ruby based which "sometimes" fails to find a redis container on the same podman network. I can reproduce the issue using the following on our network:

docker-compose.wml

version: '2.1'
services:
        httpd:
                image: <local-container-registry>/httpd:2.4.59-alpine3.19
                networks:
                        - common
                ports:
                         - 1080:80
                container_name: httpd
                hostname: httpd
        test:
                image: <local-container-registry>/alpine:3.19
                networks:
                        - common
                container_name: test
                hostname: test
                entrypoint: /usr/local/bin/entrypoint.sh
                volumes:
                        - ./entrypoint.sh:/usr/local/bin/entrypoint.sh:Z

networks:
        common:
                driver: bridge

entrypoint.sh

#!/bin/ash

while (true) ; do
        ERROR=$(ping -c 1 -q httpd 2>&1)
        if [ "$?" -ne "0" ]; then
                echo $(date -Is) failed with: ${ERROR}
        fi
        sleep 1s
done

We see around 10% DNS lookup failures when running the above for around an hour.

We've tried the following, but still get the same failure rate:

What does work is either switching back to docker, or switching to a different flavour of Linux (we've tried OL8-slim and Debian variants)