My school blocks DNS request packets to any host except school’s DNS server.
But many Docker image uses 8.8.8.8
and 8.8.4.4
as DNS server.
append --dns a.b.c.d
to docker run
command fix this problem temporarilly. But this option cannot be used on build
command. So I have to use another solution.
Append --dns a.b.c.d
to docker daemon command.
# /etc/default/docker
DOCKER_OPTS="--dns a.b.c.d"
Update – 2017-08-20
Just use /etc/docker/daemon.json
to do this:
{
"dns": ["a.b.c.d"]
}