If not the root user, add sudo before the command

1. Create a directory to store the index

mkdir -p /data/opengrok/data

image.png

2. Pull the latest image of opengrok

docker pull scue/docker-opengrok:latest

image.png

3. Start the opengrok container

docker run -itd --restart=always -v {project directory path}:/src -v /data/opengrok/data:/data -p 8090:8080 --name opengrok scue/docker-opengrok
  • {Project directory path}: fill in the project code directory on your service
  • /data/opengrok/data: just created the directory to store the index
  • -p 8090:8080: open 8090 on the left to the port you want to be accessible to the outside world, for example: http://{server ip}:8090/source

image.png

Browser access: http://{server ip}:8090/source

4. Reindex after code update

into the container

docker exec -it opengrok bash

image.png

reindex

/opengrok-0.12.1.5/bin/OpenGrok index /src

image.png

exit the container

exit

image.png

5. Stop the container

docker stop opengrok

6. Delete the container

docker rm -f opengrok

image.png

Likes(0)

Comment list count 0 Comments

No Comments