How to assign IPv6 address with docker-compose

后端 未结 2 1625
悲哀的现实
悲哀的现实 2021-01-13 09:48

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-

2条回答
  •  一个人的身影
    2021-01-13 09:53

    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
    

提交回复
热议问题