Issues with docker build command and github
I’m trying to run a dev env as docker machine,
I created the following docker file
FROM rails:4.2 MAINTAINER Chen Kinnrot <email@example.com> RUN mkdir -p /var/app COPY Gemfile /var/app/Gemfile WORKDIR /var/app RUN bundle install CMD rails s -b 0.0.0.0
docker build -t dev .
I get the follwing message
fatal: unable to connect to github.com:
github.com: Name or service not known
Why is that, and how can I solve this annoying issue?
One Solution collect form web for “Issues with docker build command and github”
This is a known issue with VirtualBox / boot2docker; when switching networks, boot2docker sometimes looses its DNS information. See these issues; https://github.com/boot2docker/boot2docker/issues/776, https://github.com/docker/machine/issues/1857
You can either try to restart the machine;
docker-machine stop default docker-machine start default
Or set the right name server to the virtual machine;
docker-machine ssh default echo "nameserver 126.96.36.199" > /etc/resolv.conf