Docker Community Forums

Share and learn in the Docker community.

Network errors when switching wireless networks

docker

(Tony Pujals) #1

Expected behavior

After switching wireless networks, network / DNS requests should succeed when building an image.

Actual behavior

Errors:

$ docker-compose build
Building web
Step 1 : FROM atomiq/node:onbuild
# Executing 3 build triggers...
Step 1 : COPY package.json /usr/src/app/
Step 1 : RUN npm install --loglevel error   ### -- THIS WILL TAKE A WHILE! Go get some coffee. -- ###
 ---> Running in 50730e122d50
npm ERR! Linux 4.4.6
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--loglevel" "error"
npm ERR! node v5.8.0
npm ERR! npm  v3.7.3
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log
ERROR: Service 'web' failed to build: The command '/bin/sh -c npm install --loglevel error ' returned a non-zero code: 1

Information

  • the output of:
    • pinata diagnose -u on OSX
OS X: version 10.11.3 (build: 15D21)
Docker.app: version v1.11.0-beta7
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/20160418-062304.tar.gz
Most specific failure is: No error was detected
Your unique id is: 537EFDB5-67ED-4BAF-8982-9A848BE93025
Please quote this in all correspondence.
  • host distribution and version ( OSX 10.10.x, OSX 10.11.x, Windows, etc )

OSX 10.11.3

Steps to reproduce the behavior

  1. Switch wireless network

Notes

This happens frequently. The solution is to restart the Docker daemon. This issue is not specific to Docker for Mac beta (it happens with Docker Machine as well).


(Micheal Waltz) #2

I can confirm that this also happens with me if I connect/disconnect from a VPN using the built-in OSX VPN configuration utility.


(Dave Tucker) #3

Is this still an issue with the latest beta?


(Donmartin76) #4

Yes, I just experienced such an issue with Docker Beta. I just installed it today. In a first run, npm succeeded in creating an image, in the subsequent docker build runs, nothing succeeds, npm is not able to retreive any packages. I am using the 4.4-onbuild base image.


(Paolo D.) #5

Urgh, have the same problem, very annoying!
I commute with the train and work offline.
At work, when switching from wifi to ethernet, i found the external network unreachable from the docker vm.

I am on beta 12.


(Kobenauf) #7

Same issue here. I can ping registry.npmjs.org and even view the json in a browser, but docker-compose build gave this error every time. Rebooting “fixed” the symptom and let me continue on my way.