Docker Ping

If you have installed docker using the vagrant method. That is, if you had cloned docker from github, you would have along with the some cool docker code also got a Vagrantfile.

This Vagrantfile could be used with vagrant to spin a docker host. Once you had done that using…

# vagrant up

That would have spun up a virtualbox vm with all the need components of Docker installed. Great! Or is it?

From within the vm i ran a docker container

# docker run -i -t ubuntu /bin/bash

And when tried to ping it just wouldn’t. Well then I figured out that packet forwarding was disabled in the host vm, so went ahead and enabled it by setting theĀ net.ipv4.ip_forward flag in the /etc/sysctl.conf file on virtualbox vm.

# Uncomment the next line to enable packet forwarding for IPv4

Then the rebooted the vm. Started a docker container and tried to ping and it work flawlessly.

Show Comments