May 21, 2016

Serve OpenGrok Search with Docker

The repository https://github.com/dyno/docker-opengrok

The Goal

  • I want to use OpenGrok to help myself to read code. The process involved
    • index the code.
    • deploy the webapps and server the search request.
  • In addition to that,
    • I want to use latest OpenGrok code which I cloned from github.
  • the Docker container concept is very appealing to create an application independent of it’s running environment which just like Java as runtime for program. This Stackoverflow thread capture the spirit.
    • The build and index process are very opengrok specific so I created my own docker image Dockerfile.
    • The Application Server is pretty standard so I use tomcat:8-jre8.

The Setup

  • opengrok.env
    • souce code ~/gitroot
    • the index ~/opengrok/data
    • OpenGrok source code git clone https://github.com/OpenGrok/OpenGrok.git

The Steps

  • Create Docker image dynofu/codeserver:v2 (Dockerfile):
    • docker build -t dynofu/codeserver:v2 .
  • Build the OpenGrok to produce source.war:
    • ./run_opengrok_build.sh
  • Index the source code with OpenGrok index:
    • ./run_opengrok_index.sh
  • Serve the search with docker image tomcat:8-jre8:
    • ./run_opengrok_serve.sh