Search code examples
dockerdocker-composedocker-network

Docker (docker-compose.yml file) Define the Network


This is pertaining to Docker and docker-compose file: I saw this in an answer a while ago and I need some clarification from the below code .

networks:
  cfsext:
    driver: macvlan
    **ipam:** <- What is this for?
    config:
      - subnet: 192.168.1.0/24
        gateway: 192.168.1.1

Thanks Michael


Solution

  • ipam is an object where you can define your config under it like ip_Address, gateway, ip_address range

    **https://docs.docker.com/compose/compose-file/compose-file-v2/#ipam