boot2docker config

(λx.x)eranga
Effectz.AI
Published in
2 min readFeb 13, 2017

View configs

All configurations of boot2docker vm can be viewed via following command with VBoxManage.

VBoxManage showvminfo “boot2docker-vm”

Enabling DNS proxy in NAT mode

By default boot2docker cannot access host file(/etc/hosts) configurations in host machine, to enable this following command can be used

VBoxManage modifyvm “boot2docker-vm” — natdnshostresolver1 on

Port forwarding

Incoming traffic for host machine tcp/udp ports can be forward to vm port by following command

# tcp rule
VBoxManage controlvm "boot2docker-vm" --natpf1 "tcp-port7070,tcp,,7070,,7070";
# udp rule
VBoxManage modifyvm "boot2docker-vm" --natpf1 "udp-port9090,udp,,9090,,9090";
# delete rule
VBoxManage modifyvm "boot2docker-vm" --natpf1 delete "tcp-port7070"

Connect to boot2docker

We can connects to boot2docker vm via ssh

boot2docker ssh

Config file

Boot2docker config file uses as the docker config

/var/lib/boot2docker/profile

Following is an example config file content, in here I have defined two configurations(disable tls and define insecure registry)

Disable TLS

By default docker runs with TLS enable. To disable it add following content to boot2docker profile. More info

DOCKER_TLS=no

Insecure registry

Docker default supports for secure registries with TLS enable, to have insecure registries following content need to be added to boot2docker config file

EXTRA_ARGS=" —-insecure-registry=10.4.1.110"

Increase boot2docker vm size

boot2docker space and memory information can be defined in boot2docker profile at ~/.boot2docker/profile

# vm disk image size in MB (60GB)
DiskSize = 61440
# vm memory size in MB(6GB)
Memory = 6144

To apply this configuration boot2docker need to be reinitialize.

# destroy running boot2docker
boot2docker stop
boot2docker destroy
# reinitialize
boot2docker init
boot2docker start

New configuration can be viewed from boot2docker

# connect to boot2docker
boot2docker ssh
# memory info
cat /proc/meminfo

--

--