$ docker-machine create -d virtualbox --virtualbox-disk-size "200000" --virtualbox-memory 4096 --virtualbox-hostonly-cidr "192.168.90.1/24" default
$ docker-machine upgrade default
$ eval "$(docker-machine env default)"
$ docker build -t manfeel/aosp-build-env .
$ cd /path/to/your/android/source/root
$ docker run -i -v $PWD:/android -t manfeel/aosp-build-env /bin/bash
Stop the docker-machine vm:
$ docker-machine stop default
Then connect to your VPN and restart the docker vm:
$ docker-machine start default
$ eval "$(docker-machine env default)"