I want to use the
docker create --publish <containerPort> command in order to:
- Create a container without running it
- Get the published port on the host
- Change the configuration file in the container, through a mounted file, to include the published port (which I need for X-Forwarded-Port)
- Run the container
create command does not “reserve” any port yet - it’s done only when the container is actually started.
Is that the expected behaviour? Or do I miss something here?
Thanks for any help,