Why does pushing a Docker image fail with “dial tcp: lookup cdn-registry-1.docker.io on 192.168.1.1:53: read udp 192.168.1.1:53: 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 192.168.1.1:53: read udp 192.168.1.1:53: 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.

  • Is NoRestart policy supported for Kubernetes pods?
  • Running mnist_softmax.py on Tensorflow Installed with Docker
  • Docker in docker on AWS Elastic Beanstalk
  • Docker-compose does not install or run properly on boot2docker
  • ADD command failing while building dockerfile using docker-build-step plugin in jenkins
  • Windows Containers : Unable to ping containers created with transparent network from other hosts
  • Anyone see this before? Tips on how to resolve?

  • Error: failed to checkpoint one or more containers
  • Apache Storm FileNotFoundException in Cluster Mode
  • Should I containerize a standalone command-line or terminal application which requires 16 vCPU?
  • Getting “This application is already running”, but can't find RUNNING_PIT
  • Docker: Change word in file at container startup
  • Django channels and docker-compose error
  • One Solution collect form web for “Why does pushing a Docker image fail with “dial tcp: lookup cdn-registry-1.docker.io on 192.168.1.1:53: read udp 192.168.1.1:53: 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 https://192.168.59.103:2376/v1.19/images/create?fromImage=...: x509: certificate is valid for 127.0.0.1, 10.0.2.15, not 192.168.59.103
    

    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

    Update:

    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.