Couldn't resolve host '' when building image

Expected behavior

My Dockerfile (based off ubuntu:12.04) runs

RUN wget --quiet -O - | apt-key add -

before installing postgres. Expected behavior is that this line works without error.

Actual behavior

It errors, and running the wget by itself I get

wget: unable to resolve host address `'


$ pinata diagnose -u
OS X: version 10.11.4 (build: 15E65) version v1.11.0-beta8.2
Running diagnostic tests:
[OK]      docker-cli
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      db
[OK]      slirp
[OK]      menubar
[OK]      environment
[OK]      Docker
[OK]      VT-x
Docker logs are being collected into /tmp/20160425-165504.tar.gz
Most specific failure is: No error was detected
Your unique id is: 3157731F-92A3-4693-81AE-F7E849BE4AC2
Please quote this in all correspondence.

Trimmed down Dockerfile:

FROM ubuntu:12.04
USER root
RUN apt-get update -q && apt-get install -qy \
  wget \
  && rm -rf /var/lib/apt/lists/*
RUN wget --quiet -O - | apt-key add -

Steps to reproduce the behavior

  1. docker build -f path/to/Dockerfile .

I had the same happen on a fresh install. I went to Docker Settings and switched off VPN compatibility mode and it started working.

Hm I tried that but I’m noticing that if I untick the box, close the settings window, and reopen the settings window, then “VPN compatibility mode” is re-checked. Maybe it’s not sticking?