Docker have just released 1.9 which finally brings Libnetwork out of experimental and into the main release. I’ve been working with Docker and the Libnetwork developers since back in April and I’m really excited that users will now be able to use Calico with Docker without needing to install special experimental versions of Docker or needing to add networking to containers after they’ve already been started.
I’m going to quickly run through what it takes to get started with Calico and libnetwork. We also have in depth guides if you want to try yourself, either in a local VM using Vagrant or in the cloud.
First step is to make sure the right version of Docker us running. See the Docker 1.9 release for instructions on upgrading.
To get multihost docker networking running, libnetwork requires a datastore. Docker supports etcd, consul and zookeeper and I’ll use etcd so that Calico can share the same datastore.
To start I’ll grab the latest etcd release, unpack it and run it. I’m just going to run a single node “cluster” but for a production deployment a multi node cluster is highly recommended.
curl -L http://github.com/coreos/etcd/releases/download/v2.2.1/etcd-v2.2.1-linux-amd64.tar.gz -o etcd-v2.2.1-linux-amd64.tar.gz
tar xzvf etcd-v2.2.1-linux-amd64.tar.gz
./etcd --advertise-client-urls http://10.0.2.15:4001--listen-client-urls http://0.0.0.0:4001
Now that etcd is running I can start Docker in another terminal, pointing it at etcd using the
systemctl stop docker # Stop my current docker daemon
./docker daemon --cluster-store=etcd://10.0.2.15:4001
Docker and etcd are now running so I can start creating containers and networking them using Calico.
Starting the Calico agent
I can grab the latest release of
calicoctl from the calico-docker release page.
chmod +x calicoctl
sudo calicoctl node --libnetwork
That’s it! Calico is installed and running with just those 3 simple commands.
Working with networks
Docker has added a new subcommand “
docker network". Using this command I can create new networks that are backed by the Calico driver.
docker network create –d calico my_network
Now that the network is created containers can be started using that network
docker run –net my_network --ti busybox ifconfig
After getting the Docker daemon setup up with a backing store, using Calico is as simple as grabbing a file and running it in order to start a containerized version of the calico agent.
The new Docker UX is clean and simple and makes getting started with Calico very easy. Give it a try today!
Join our mailing list
Get updates on blog posts, workshops, certification programs, new releases, and more!