Skip to content

host.docker.internal does not resolve properly #2965

@128keaton

Description

@128keaton
  • I have uploaded Diagnostics
  • I have tried with the latest version of my channel (Stable or Edge)
  • Diagnostics ID: 80B22EC8-EBD9-42FA-ABC5-67F685FD5DD1

Expected behavior

host.docker.internal to resolve properly

Actual behavior

host.docker.internal does not resolve to anything.

Information

  • macOS Version: 10.12.6

Diagnostic logs

Docker for Mac: version: 18.03.1-ce-mac65 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
macOS: version 10.12.6 (build: 16G1314)
logs: /tmp/80B22EC8-EBD9-42FA-ABC5-67F685FD5DD1/20180601-094343.tar.gz
[OK]     vpnkit
[OK]     vmnetd
[OK]     dns
[OK]     driver.amd64-linux
[OK]     virtualization VT-X
[OK]     app
[OK]     moby
[OK]     system
[OK]     moby-syslog
[OK]     kubernetes
[OK]     files
[OK]     env
[OK]     virtualization kern.hv_support
[OK]     osxfs
[OK]     moby-console
[OK]     logs
[OK]     docker-cli
[OK]     disk

Steps to reproduce the behavior

(simple demo)

  1. docker run --rm alpine nslookup host.docker.internal
  2. screen shot 2018-06-01 at 9 49 04 am

(use in dev)


services:
  php:
    build:
      context: dev/docker/php
      args:
        TIMEZONE: ${TIMEZONE}
        LOCAL_USER_ID: ${LOCAL_USER_ID}
    networks:
      main:
        aliases:
          - php
    environment:
      COMPOSER_ALLOW_SUPERUSER: 1
    volumes:
      - nfsmount:/var/www/site
      - ~/.ssh:/home/www-data/.ssh
volumes:
  nfsmount:
    driver: local
    driver_opts:
      type: nfs
      o: addr=addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
      device: ":${PWD}"

Running docker-compose up with this configuration results in:
ERROR: for php Cannot create container for service php: error resolving passed in nfs address: lookup addr=host.docker.internal: no such host

I have tried rebooting and resetting Docker. I'd rather not update to 10.13.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions