- Select the version of the docker image
- Set the container name
- Pull the docker image
- Set the data directory
- Set the port forwarding rules
- Set the run command
- Run the Solr container
- Inspect the container
- See the container logs
- Kill the container
- Remove the container
- Remove the data directory
- References
IMAGE=solr
TAG=8.8.2
NAME=solr
docker pull $IMAGE:$TAG
VOLUMES="`pwd`/data:/var/solr"
PORTS="127.0.0.1:8983:8983"
COMMAND="solr-precreate gettingstarted"
docker run -d --name $NAME -p "$PORTS" -v "$VOLUMES" $IMAGE:$TAG $COMMAND
docker inspect $NAME
docker logs $NAME
docker kill $NAME
docker rm $NAME
rm -rf data