In the Docker Compose file, I can easily publish a number of ports using short form syntax:
ports: - "3000-3010:3000-3010/udp"
But in my case, I need these ports as "mode = host" to bypass the swarm overlay network. Short form syntax cannot express this, so I need to use long-form:
ports: - published: "3000-3010" target: "3000-3010" protocol: udp mode: host
However, it seems that Docker does not like to specify ranges with long-form syntax, as I get this error when deploying the stack:
services.test.ports.0.target must be an integer
Is there a way to do this (other than brute force, specifying each port in the range as long-form)?
docker docker-compose docker-swarm
William H.
source share