in contribution linux IT programming ~ read.

docker-machine error with virtualbox: server misbehaving

I am running docker-machine on my Arch Linux laptop and when creating new virtualbox docker-machine by:

$ docker-machine create \ 
    --driver virtualbox \ 
    --virtualbox-cpu-count 2 \
    --virtualbox-memory 2048 pipeline

I had then problems with pulling new containers (and probably accessing internet in general) from the inside of the machine, e.g.:

$ docker-compose -f docker-compose.yml build
Building common_folder  
Step 1 : FROM busybox  
Pulling repository  
ERROR: Service 'common_folder' failed to build:  
Error while pulling image:  
dial tcp: lookup on server misbehaving  

The port 53 and weird address gave me a hint that it is about DNS and that lead to resolve.conf. So I ssh inside the machine:

$ docker-machine ssh pipeline                                                 

and run

sudo echo "nameserver" > /etc/resolv.conf  
ping # test the connection  

and then it worked!