You can run Solr in Docker via the official image.
To run Solr in a container and expose the Solr port, run:
docker run -p 8983:8983 solr
In order to start Solr in cloud mode, run the following.
docker run -p 8983:8983 solr solr-fg -c
For documentation on using the official docker builds, please refer to the DockerHub page. Up to date documentation for running locally built images of this branch can be found in the local reference guide.
There is also a gradle task for building custom Solr images from your local checkout. These local images are built identically to the official image except for retrieving the Solr artifacts locally instead of from the official release. This can be useful for testing out local changes as well as creating custom images for yourself or your organization. The task will output the image name to use at the end of the build.
./gradlew docker
Or if you want to test with the "slim" Solr distribution:
./gradlew docker -Psolr.docker.dist=slim
For more info on building an image, run:
./gradlew helpDocker
You can find additional information in the Solr Ref Guide Docker Page