Skip to content
Chris Swan edited this page May 5, 2015 · 3 revisions

Get Pipework

Install Pipework

sudo wget http://is.gd/onugpw -O /usr/bin/pipework
sudo chmod +x /usr/bin/pipework

Full URL for is.gd/onugpw is https://raw.githubusercontent.com/jpetazzo/pipework/master/pipework

Connect together some containers

Start another container

CON1=$(sudo docker run --net=none -d cpswan/todomvc.mysql)

The container launched with --net=none at the end of Part 3 is still running.

Add first container to a bridge

sudo pipework br1 $CON1 192.168.1.1/24

Ignore Warning: arping not found; interface may not be immediately reachable

Add second container to a bridge

NB This is the container that was started at the end of Part 3

sudo pipework br1 $CON2 192.168.1.2/24

Test connectivity

Shell into first container

sudo docker exec -it $CON1 bash

exec allows another command to be run in the container namespace, in this case a bash shell

Show address

ip addr

eth1 will be 192.168.1.1/24 as set by Pipework

Connect to second container for Hello World

curl 192.168.1.2:8080
exit