1. DNS Request Timeout
Cause: alpine uses the musl library, which has some limitations in DNS resolution [1]
Solution:
Do not use an apline image, and add the options single-request-reopen setting to the container’s resolv.conf file. This is because the single-request-reopen option only takes effect for the glibc library, while apline images use the musl library.
2. Unable to Resolve hosts under Docker
Cause:
alpine has no /etc/nsswitch.conf, so processes that depend on hosts cannot resolve hosts.
Solution:
Add the following command in the Dockerfile:
| |
