moby: Docker Windows CE, DNS not working from docker-compose up

Description

After upgrading from Docker for Windows 1.13.1 to CE, containers running in Docker Compose can no longer resolve names via DNS. The same images launched via “docker run” do allow DNS name resolution.

My Docker compose file has no custom networking or DNS settings.

When running in either version of Docker for Windows, /etc/resolv.conf shows the nameserver as 192.168.65.1 when the container is launched via “docker run”, and 127.0.0.11 when launched via “docker-compose”.

Steps to reproduce the issue:

  1. Install Docker for Windows 17.03.0-ce
  2. In an empty directory, create a Dockerfile that is just “FROM httpd”
  3. In the same directory, create a Docker Compose file like this:
version: '3'

services:
  httpd:
    build: 
       context: .
       dockerfile: dockerfile.test

  1. Execute “docker-compose build”
  2. Execute “docker run httpd”
  3. Execute “docker ps” to get the container name
  4. Execute “docker exec -it CONTAINER_NAME bash”
  5. In the shell, do a “ping www.google.com”, it works
  6. Exit the shell, run “docker kill CONTAINER_NAME”
  7. Execute “docker-compose up”
  8. Repeat steps 6-8, and in my case, I could not reach www.google.com
  9. In the shell, confirm you can ping Google by IP address (74.125.203.106)
  10. Exit the shell, run “docker kill CONTAINER_NAME”
  11. If you want, uninstall Docker CE, reinstall 1.13.1, and execute 10-13, you should now be able to ping by DNS name

Describe the results you received:

When running containers via Docker Compose using the most recent release of Docker for Windows CE, I am unable to resolve host name via DNS

Describe the results you expected:

When running containers via Docker Compose using the most recent release of Docker for Windows CE, I am would like to resolve host name via DNS, just like I could in 1.13.1

Additional information you deem important (e.g. issue happens only occasionally):

Nothing very special about my machine setup. Windows 10 Professional, Hyper-V is healthy and defaults have never been touch.

I have tried CE stable and edge, same results.

I have built images that include nslookup, telnet, etc. and it looks like I am not able to make port 53 connections to the either “internal” 127.0.0.11 DNS or external (8.8.8.8).

Output of docker version:

Docker version 17.03.0-ce, build 60ccb22

Output of docker info:

Containers: 31
 Running: 0
 Paused: 0
 Stopped: 31
Images: 574
Server Version: 17.03.0-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 977c511eda0925a723debdc94d09459af49d082a
runc version: a01dafd48bc1c7cc12bdb01206f9fea7dd6feb70
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.12-moby
Operating System: Alpine Linux v3.5
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.941 GiB
Name: moby
ID: LXV7:I3LF:OGTM:HP6P:QUT3:5IQ4:H6YE:GMDE:FDM3:H4YK:2LEP:4HPO
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 13
 Goroutines: 22
 System Time: 2017-03-08T17:32:44.5063104Z
 EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.): Plenty of resources, stuff was fine under 13.1. Windows 10 Professional 64 bit with 16 GB of RAM, i7-5557U CPU.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 19 (6 by maintainers)

Most upvoted comments

I do have a similiar issue:

  • resolution of internet domains works
  • resolution of service names within compose doesn’t @jasonterando, is there any way to reopen this issue?

This issue is still happening on Windows 10 and latest build of Docker: dns resolution of internet domains eg. jenkins update) works with docker run whereas fails when running the same container with docker-compose