'Run Solr Docker Image on two different ports in a machine at same time

Is there a way to run Solr Docker Image on two different ports in a machine at same time?

I was referring this: https://hub.docker.com/_/solr but didn't find much regarding my use case. Can anyone suggest a solution to achieve it?



Solution 1:[1]

Yes, you can. Do

docker run -p 8983:8983 -d solr
docker run -p 8984:8983 -d solr

and you'll have one instance on http://localhost:8983/ and one on http://localhost:8984/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hans Kilian