May 21, 2016

Serve OpenGrok Search with Docker

The repository

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

The Steps

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