With the release of Docker 1.10, support has been added to allow users to select a specific IP address when creating a container. In order to use this feature, Docker requires that you specify the --subnet parameter when running docker network create.

Calico requires that the passed --subnet value be the same CIDR as an existing Calico IP pool.


1. Create a Calico IP pool

cat << EOF | calicoctl create -f -
- apiVersion: v1
  kind: ipPool

2. Create a Docker network using the IP pool

docker network create --driver calico --ipam-driver calico-ipam --subnet= my_net

Notice that our --subnet value is identical to our cidr above.

3. Create a container using a specific IP address from the pool

docker run --net my_net --name my_workload --ip -tid busybox

4. Verify that the IP address was assigned to the container

docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' my_workload