折腾 logspout,特别是 master branch,build Dockerfile 时可能会碰到下面的错误:
fetch http://alpine.gliderlabs.com/alpine/v3.1/main/x86_64/APKINDEX.tar.gz
ERROR: http://alpine.gliderlabs.com/alpine/v3.1/main: IO ERROR
WARNING: Ignoring APKINDEX.104533ab.tar.gz: No such file or directory
ERROR: unsatisfiable constraints:
go (missing):
required by: world[go]
git (missing):
required by: world[git]
mercurial (missing):
required by: world[mercurial]
Service 'logspout' failed to build: The command '/bin/sh -c cd /src && ./build.sh "$(cat VERSION)-custom"' returned a non-zero code: 3
通常你会直接用浏览器或者 curl 来试前面访问错误的 URL,却发现能正常访问。然后你就郁闷了,因为上述错误发生在 docker build 过程中,还不好调试。
据说问题是 VirtualBox 的 NAT DNS 的一个 bug,解决办法是:
VBoxManage modifyvm <vm-name> --natdnsproxy1 off --natdnshostresolver1 off