Docker Community Forums

Share and learn in the Docker community.

Docker pull ignores /etc/hosts file

insecure-registry
dns

(Gregory Davydouski) #1

Version 1.11.1-beta12 (build: 7528)

Expected behavior

Docker pull from private registry should use native OS DNS name resolution functionality

Actual behavior

GregD-MacBook:dcos-vagrant mobile$ docker pull boot.dcos:5000/devbox
Using default tag: latest
Pulling repository boot.dcos:5000/devbox
Error while pulling image: Get http://boot.dcos:5000/v1/repositories/devbox/images: dial tcp: lookup boot.dcos on 192.168.65.1:53: no such host

Information

if insecure private registry dns is configured through /etc/hosts
docker pull will still attempt to resolve DNS name directly from DNS

OS X: version 10.11.3 (build: 15D21)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x

Steps to reproduce the behavior

  1. Configure private docker registry in VM.

  2. add insecure private registry info
    {“storage-driver”:“aufs”,“debug”:true, “insecure-registries”:[“boot.dcos:5000”]}

  3. Add DNS name that resolves to the VM IP through /etc/hosts

  4. Try docker pull from insecure private registry


(Cwolfinger) #2

Have you been able to figure out how to solve this issue?


(Zoomix) #3

A workaround (of sorts) would be to modify the running xhyve VM via Moby screen (username root). details here

There you can
cat /etc/hosts
to see what’s in your host. And
echo "192.168.1.42 boot.dcos" >> /etc/hosts
to add your own in there…

Of course - you’d have to do that every time you restart docker for mac…