Why does pushing a Docker image fail with “dial tcp: lookup cdn-registry-1.docker.io on read udp i/o timeout”?

I’m pushing to a private docker repository on Docker Hub and I keep getting this error:

2726b5968341: Image successfully pushed 
2fd0731064ec: Image successfully pushed 
49328a658a81: Image successfully pushed 
6beafaa9c78d: Image successfully pushed 
bb8b822852f4: Image successfully pushed 
6a0d258340b1: Pushing 
FATA[0457] Failed to upload metadata: Put https://cdn-registry-1.docker.io/v1/images/6a0d258340b180fd569ec687653d805ebb70e77c1943ca6cfc9d296392ad79ee/json: dial tcp: lookup cdn-registry-1.docker.io on read udp i/o timeout 

I’m running Docker on Mac OS using boot2docker. After running the push command 7+ times it finally finished successfully, but I figured I’d ask anyway.

  • Environment variables with double asterisks in Dockerfile
  • Error response from daemon: chtimes /var/lib/docker/tmp/docker-export-$: invalid argument
  • Use --build-arg value in Dockerfile FROM parameter
  • Recursive error shown by docker daemon
  • install nvm in docker
  • Setup a docker MS build server image
  • Anyone see this before? Tips on how to resolve?

  • Build a Simple HTTPServer inside Docker image with Python
  • How is Docker light weight
  • Not able to read the image LABEL key and values of particular image using AWS java APIs
  • Configure fluentd to properly parse and ship java stacktrace,which is formatted using docker json-file logging driver,to elastic as single message
  • Trying the docker mysql image but user/password does not work
  • How do you determine if a docker container is running on remote docker-machine or locally running in docker engine?
  • One Solution collect form web for “Why does pushing a Docker image fail with “dial tcp: lookup cdn-registry-1.docker.io on read udp i/o timeout”?”

    • If you are using docker-machine, try restarting it:

      docker-machine restart default

      Note: default is the name of VM running the docker daemon. In case you have more than one or a different name then use the appropriate.

    • If you are using boot2docker, restart it:

      boot2docker stop
      boot2docker start

    Interwebs suggest it’s a network issue locally on your box; likely related to DNS. I’ve tried many things but restarting boot2docker fixed it.

    And if you get this issue while restarting:

    An error occurred trying to connect: Post x509: certificate is valid for,, not

    Then try reinstalling boot2docker; note that you loose all your local images

    boot2docker stop
    boot2docker delete
    boot2docker init
    boot2docker start

    Because of https://github.com/boot2docker/boot2docker/issues/968

    Good luck


    No need to boot2docker delete anymore! A fix was merged in a latter version of boot2docker (1.7.1).

    You can now boot2docker upgrade and the issue should be fixed.

    Alternatively, if that’s a problem for you, you can simply bounce docker within the boot2docker VM like so:

    boot2docker ssh 'sudo /etc/init.d/docker restart’

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.