java.net.UnknownHostException with Alpine Linux
Thu, Mar 3, 2016There is no Name Service Switch file in Alpine linux, and java need one for java.net.InetAddress.getLocalHost for example.
echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' > /etc/nsswitch.conf
Or in a Dockerfile :
RUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' > /etc/nsswitch.conf