My ISP doesn't support IPv6. I enabled dns port in tor and docker used it for its dns queries, which leaded to OP wget error in alpine containers, but not in debian ones. Host's nslookup returned NXDOMAIN error for IPv6 addresses and IPv4 were fine. On host I installed dnsmasq
and configured it to query tor's dns, and "tuned" docker to dnsmasq for all new containers. nslookup still errors IPv6 but alpine error has gone.