This is simple, just follow the below step:
-p 9200 tells Docker to find any available port on Windows and map it to the 9200container port.
Run this command:
sudo docker run -d -p 9200:9200 elasticsearch:2.3.5
With -p 9200:9200 Docker will use always 9200 that will be available in your localhost: localhost:9200