Running IPv6 containers on DigitalOcean
Create a droplet (ex. Ubuntu) and in the advanced section click “Enable IPv6 (free)”. Don’t forget the select a SSH key for remote access via SSH.
Once the droplet is running, you can access the details by clicking the droplet name. Now head to the “Networking” section.
You should see the public IPv6 and IPv4 address. Both addresses should be reachable by SSH.
ssh -6 -i ./dev/keys/digital root@2a03:b0c0:2:d0::1010:8001
Also note the Configurable Address Range. This range contains 16 IPv6 addresses. Your host is using the first IP address. In my case it looks like this:
2a03:b0c0:2:d0::1010:8000 - 2a03:b0c0:2:d0::1010:800f
So we can abbreviate this to (we need this value later)
2a03:b0c0:2:d0::1010:8000/124
Now let’s install docker
curl -fsSL https://get.docker.com -o get-docker.sh
chmod 700 ./get-docker.sh
./get-docker.sh
In the next step, we need to enable IPv6 in the docker daemon. Containers using the defaul docker bridge will be assigned an IPv6 address.
# cat >/etc/docker/daemon.json <<EOF
{
"ipv6": true,
"fixed-cidr-v6": "2a03:b0c0:2:d0::1010:8001/124",
"experimental": false,
"ip6tables": false
}
EOF