Using Docker, you can build containers based on an image you previously developed (or based on someone else image). I will not go through the process of creating a new image, the Docker documentation is here for that, but I will show you how you can use one of my images to deploy a SOLR 4.7.2 instance in one command !
On your server/computer, just run: (see previous post to install Docker on Debian 7)
docker run -d -p 127.0.0.1:2222:22 -p IP_ADDRESS:8080:8080 -t -i tehes/solr-4.7.2
This will pull the solr-4.7.2 image from my public repository, build and run the containers. Just replace IP_ADDRESS with your server's external ip address for example.
The port 2222 of the host will be redirected to the port 22 of the container.
The port 8080 of the host will be redirected to the port 8080 of the container.
Access your container:
http://IP_ADDRESS:8080 http://IP_ADDRESS:8080/solr ssh [email protected] -p 2222 (password = password // SSH only allowed from the host)
Docker special awesome point:
Now let's say you need another instance of SOLR, but with SOLR 3.6. Easy...
You just need to run my solr-3.6 image (see previous post) on differents ports:
docker run -d -p 127.0.0.1:2223:22 -p IP_ADDRESS:8081:8080 -t -i tehes/solr-3.6
And the access will be:
http://IP_ADDRESS:8081 http://IP_ADDRESS:8081/solr http://IP_ADDRESS:8081/solr/admin/ ssh [email protected] -p 2223 (password = password // SSH only allowed from the host)
The SOLR conf files of the solr-4.7.2 image are the default ones, if you need to change them, you can connect in SSH to your container, and place your files in /opt/solr/collection1/conf (don't forget to restart tomcat6, it will say "failed restart", but don't worry, tomcat6 is up !)
SOLR data are located in the container in: /opt/solr/data
Docker repository : https://registry.hub.docker.com/u/tehes/solr-4.7.2/