2

Is posible something to limit the range of ports to expose with -P parameter, like as:

docker daemon --range-ports=2000-2099...

docker run -P... <- ports used between 2000 and 2099

or

docker daemon...

docker run -P --range-ports=2000-2099... <- ports used between 2000 and 2099`

moylop260
  • 1,288
  • 2
  • 13
  • 20
  • 2
    Yes, it's right there in the docs: https://docs.docker.com/v1.8/reference/run/#expose-incoming-ports. – Oliver Charlesworth Feb 07 '16 at 20:30
  • That's a duplicate with https://stackoverflow.com/questions/28717464/docker-expose-all-ports-or-range-of-ports-from-7000-to-8000 and https://stackoverflow.com/questions/28022656/docker-expose-a-range-of-ports – Auzias Feb 08 '16 at 06:02
  • @Auzias I'm talking about `-P` parameter with uppercase. – moylop260 Feb 08 '16 at 20:53

2 Answers2

1

you can give range of ports to be mapped;

docker run -d -p 8000-9000:5000 training/webapp python app.py
East2West
  • 657
  • 1
  • 6
  • 22
0

FYI I have created follow issue: docker#20091

The answer was: docker run .... -p 2000-2099:22 -p 2000-2099:23 -p 2000-2099:24 ....

Thank you for your answer

moylop260
  • 1,288
  • 2
  • 13
  • 20