I am using docker 1.12.1 on Ubuntu 16.04, and docker-compose 1.8.1. I am trying to get the Compose file from https://docs.docker.com/compose/compose-file/#ipv4-address-ipv6-
It turns out this is indeed a docker-compose bug that is going to be fixed in 1.9.0.
Meanwhile, there is a workaround by creating a custom network with the docker network command:
docker network create --subnet=172.16.2.0/24 --gateway=172.16.2.1 --ipv6 --subnet= dockerbridge
... which can then be made available inside docker-composed.yml by writing
networks:
dockerbridge:
external:
name: dockerbridge