Docker Community Forums

Share and learn in the Docker community.

Can't get networking to work with docker containers

Hello,

I’ve been reading the docker container networking document to try and get
my ubuntu containers to connect to the internet via my digital ocean droplet.

It says to do the following:

You can attach to a running container and investigate its configuration:

Then use ping to send three ICMP requests and test the connectivity of the containers on this bridge network

But the ubuntu container has no ping utility. Can someone explain what I need to do here?

Thanks,

yeah , I have had this issue , you will need use a ubuntu:14.04 container

or install ping the one you have

run this command “docker run -it ubuntu:14.04 bash”

docker@docker-datacenter-demo-3:~$ docker run -it ubuntu:14.04 bash
root@ead5e7163482:/# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=11.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=45 time=12.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=45 time=11.3 ms

Aha! Progress! Thanks.
I can get ping to work. Do I need to open up specific ports to allow apt to work?
Right now it can’t install anything…

I just built one up on digital ocean and I trying to see what works etc.

one minute

run “apt-get update” first

and then I was able to install wget
root@d0fb7d313577:/# apt-get install wget
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following extra packages will be installed:
ca-certificates libidn11 openssl
The following NEW packages will be installed:
ca-certificates libidn11 openssl wget