Open All Docker Ports

I am deploying an application inside a docker container that randomly assigns ports at startup. The problem is what I want to use docker-compose, but is there a way to expose all ports for a service using docker-compose? Without docker layout, I would usedocker run ... -P

thank

+4
source share
1 answer

I would recommend using port ranges i.e.

ports: - "1-65535:1-65535"

You will probably need to tinker with this range according to your application specifications so that you do not accidentally discover what is already being used by the host (e.g. SSH).

+6
source

Source: https://habr.com/ru/post/1660583/


All Articles