Search code examples
dockerboot2dockerdocker-machine

How can I update DOCKER_OPTS in docker-machine permanently


After update to docker-machine, I have no idea how to update DOCKER_OPTS in a local boot2docker docker-machine and save it permanently

$ docker-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                         SWARM
dev    *        virtualbox   Running   tcp://192.168.99.100:2376

I tried to ssh into vm with docker-machine ssh dev, and update /etc/docker/default. But the changes I made are dropped after restart VM with docker-machine restart dev.


Solution

  • As of docker-machine 0.5.0, the mirror can be provisioned with --engine-registry-mirror

    docker-machine create -d virtualbox --engine-registry-mirror http://mirror.dockerhub.com dev
    

    --engine-registry-mirror [--engine-registry-mirror option --engine-registry-mirror option] Specify registry mirrors to use