Skip to content

DNS not working in Docker Compose #115

Description

@boostpaal

DNS lookups fail in Docker Compose 2.3.

docker-compose.yml

version: '2.3'
services:
  gvisor_test:
    command: node /home/test.js
    image: node:8-alpine
    runtime: runsc
    volumes:
      - /home/ubuntu/compose/test.js:/home/test.js

test.js

const http = require('http')
http.get('http://www.google.com', res => console.log(res))

Error:

$ docker-compose up
Starting compose_gvisor_test_1 ... done
Attaching to compose_gvisor_test_1
gvisor_test_1  | events.js:183
gvisor_test_1  |       throw er; // Unhandled 'error' event
gvisor_test_1  |       ^
gvisor_test_1  | 
gvisor_test_1  | Error: getaddrinfo EAI_AGAIN www.google.com:80
gvisor_test_1  |     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
compose_gvisor_test_1 exited with code 1
$ uname -a
Linux ubuntu-2 4.15.0-36-generic #39~16.04.1-Ubuntu SMP Tue Sep 25 08:59:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
$ docker version
Client:
Version:           18.09.0
API version:       1.39
Go version:        go1.10.4
Git commit:        4d60db4
Built:             Wed Nov  7 00:48:57 2018
OS/Arch:           linux/amd64
Experimental:      false

Server: Docker Engine - Community
Engine:
 Version:          18.09.0
 API version:      1.39 (minimum version 1.12)
 Go version:       go1.10.4
 Git commit:       4d60db4
 Built:            Wed Nov  7 00:16:44 2018
 OS/Arch:          linux/amd64
 Experimental:     false

I've tried using the use-vc and other resolve options in Compose (http://man7.org/linux/man-pages/man5/resolv.conf.5.html) to force TCP over UDP, with no luck:

version: '2.3'
services:
  gvisor_test:
    command: node /home/test.js
    image: node:8-alpine
    runtime: runsc
    volumes:
      - /home/ubuntu/compose/test.js:/home/test.js
    dns_opt:
      - use-vc

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: container runtimeIssue related to docker, kubernetes, OCI runtimearea: docsIssue related to docsarea: integrationIssue related to third party integrationsarea: networkingIssue related to networking

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions