wget: unable to resolve host address 'github.com' inside alpine docker image

Viewed 2263
/ # wget -O - https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_ID}
_Linux-64bit.tar.gz
--2021-02-09 08:03:32--  https://github.com/gohugoio/hugo/releases/download/v0.76.5/hugo_extended_0.76.5_Linux-64bit.tar.gz
Resolving github.com (github.com)... failed: Name does not resolve.

Inside alpine, I was unable to resolve github.com. I checked /etc/hosts and didn't find anything wrong. However other sites like google.com did resolve.

1 Answers

wget needs to be on ipv4.

wget -4 -O - https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/${HUGO_
ID}_Linux-64bit.tar.gz
Related