Docker daemon config file on boot2docker / docker-machine / Docker Toolbox

anaid picture anaid · Oct 17, 2014 · Viewed 22.3k times · Source

Where can I find docker daemon config file on boot2docker machine?

According to this topic: Dockerfile: Docker build can't download packages: centos->yum, debian/ubuntu->apt-get behind intranet

I want to set '--dns' in DOCKER_OPTS, but I can't find this config file either at /etc/default or anywhere else.

Answer

Carlos Rafael Ramirez picture Carlos Rafael Ramirez · Nov 6, 2014

Inside boot2docker (boot2docker ssh) / docker-machine (docker-machine ssh default) , open or create the file /var/lib/boot2docker/profile and add the following line:

EXTRA_ARGS="--dns 192.168.1.145"

Also works for:

EXTRA_ARGS="--insecure-registry myinternaldocker"

After the change you need to restart the docker daemon:

sudo /etc/init.d/docker restart

Or leave boot2docker / docker-machine and restart the entire virtual machine:

boot2docker restart
# for docker machine
docker-machine restart default

Information taken from: https://groups.google.com/d/msg/docker-user/04pAX57WQ7g/_LI-z8iknxYJ

Regards