When run any apk add ...
command while docker build ...
I get DNS lookup error
:
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/main: DNS lookup error
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
ERROR: http://dl-cdn.alpinelinux.org/alpine/v3.8/community: DNS lookup error
How do I fix this?
It seems that my Dokcer inside of docker-machine
had troubles resolving DNS.
I added this file /etc/docker/daemon.json
into machine to make everything work correctly:
{
"dns": ["8.8.8.8", "192.168.0.1"]
}
Also you may use docker run --dns 8.8.8.8 ...
if you just run container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With