Issues with docker build command and github

I’m trying to run a dev env as docker machine,

I created the following docker file

  • Basic Dockerfile not running CMD command
  • Can docker host ping its containers?
  • How to have my docker daemon log print to logfile not to STDOUT?
  • Integration tests for continuous delivery using docker
  • Running Kubernetes Example on CoreOS, Part 1 not work
  • Docker - Can't access MySQL CLI in container
  • FROM rails:4.2
    MAINTAINER Chen Kinnrot <kinnrot@gmail.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
    

    When Running 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?

  • docker: how to restart containers from files from /var/lib/docker/containers
  • Command line arguments to Docker CMD
  • docker(1.5.1) artifactory (3.x) registry management
  • Jenkins Mesos — Error: Unable to access jarfile
  • How to move docker installation to another machine?
  • How to use Docker Swarm On Mesos?
  • 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 8.8.8.8" > /etc/resolv.conf
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.