Skip to content

Commit 4aedc80

Browse files
committed
change according to review
1 parent c405776 commit 4aedc80

File tree

7 files changed

+84
-33
lines changed

7 files changed

+84
-33
lines changed

.gitignore

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,3 @@ pmd.bat
5252
*.pyc
5353
.wercker
5454
.DS_Store
55-
.project
56-
.settings/
57-
.vscode/
58-
distribution/.project
59-
distribution/.settings/
60-
opengrok-indexer/.classpath
61-
opengrok-indexer/.project
62-
opengrok-indexer/.settings/
63-
opengrok-indexer/bin/
64-
opengrok-tools/.project
65-
opengrok-tools/.settings/
66-
opengrok-web/.classpath
67-
opengrok-web/.project
68-
opengrok-web/.settings/
69-
opengrok-web/bin/
70-
plugins/.classpath
71-
plugins/.project
72-
plugins/.settings/
73-
plugins/bin/
74-
suggester/.classpath
75-
suggester/.project
76-
suggester/.settings/
77-
suggester/bin/

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ Copyright (c) 2006, 2018 Oracle and/or its affiliates. All rights reserved.
1010
[![AppVeyor status](https://ci.appveyor.com/api/projects/status/8oqlk5yx2c5fnwqw/branch/master?svg=true)](https://ci.appveyor.com/project/vladak/opengrok-b5hnp/branch/master)
1111
[![License](https://img.shields.io/badge/License-CDDL%201.0-blue.svg)](https://opensource.org/licenses/CDDL-1.0)
1212

13-
1. [Introduction](#1-introduction)
14-
2. [OpenGrok setup](#2-opengrok-install-and-setup)
15-
3. [Information for developers](#3-information-for-developers)
16-
4. [Authors](#4-authors)
17-
5. [Contact us](#5-contact-us)
18-
7. [Demo](#6-demo)
13+
- [OpenGrok - a wicked fast source browser](#opengrok---a-wicked-fast-source-browser)
14+
- [1. Introduction](#1-introduction)
15+
- [2. OpenGrok install and setup](#2-opengrok-install-and-setup)
16+
- [3. Information for developers](#3-information-for-developers)
17+
- [4. Authors](#4-authors)
18+
- [5. Contact us](#5-contact-us)
19+
- [6. Run as container](#6-run-as-container)
1920

2021
## 1. Introduction
2122

@@ -53,6 +54,6 @@ To subscribe, send email to `<mailing_list_name>[email protected]`
5354

5455
There are also Slack channels on https://opengrok.slack.com/
5556

56-
## 6. Demo
57+
## 6. Run as container
5758

58-
Anyway, just demo it yourself - there are Docker images available on https://hub.docker.com/r/opengrok/docker/
59+
You can run opengrok as a docker container as described [here](docker/readme.md).
File renamed without changes.
File renamed without changes.

docker/readme.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[![Travis status](https://travis-ci.com/OpenGrok/docker.svg?branch=master)](https://travis-ci.com/OpenGrok/docker)
2+
3+
# A Docker container for OpenGrok
4+
5+
## OpenGrok from official source:
6+
7+
Directly downloaded from official source:
8+
https://github.com/oracle/opengrok/releases/
9+
10+
You can learn more about OpenGrok at http://oracle.github.io/opengrok/
11+
12+
The container is available from DockerHub at https://hub.docker.com/r/opengrok/docker/
13+
14+
## When not to use it
15+
16+
This image is simple wrapper around OpenGrok environment. The indexer and the web container are **not** tuned for large workloads. If you happen to have either large source data (e.g. [AOSP](https://en.wikipedia.org/wiki/Android_Open_Source_Project) or the like) or stable service or both, it is advisable to run the service standalone.
17+
18+
## Additional info about the container:
19+
20+
* Tomcat 9
21+
* JRE 8 (Required for Opengrok 1.0+)
22+
* Configurable mirroring/reindexing (default every 10 min)
23+
24+
The mirroring step works by going through all projects and attempting to
25+
synchronize all its repositories (e.g. it will do `git pull` for Git
26+
repositories).
27+
28+
The indexer/mirroring is set so that it does not log into files.
29+
30+
## How to run:
31+
32+
The container exports ports 8080 for OpenGrok.
33+
34+
docker run -d -v <path/to/your/src>:/opengrok/src -p 8080:8080 opengrok/docker:latest
35+
36+
The volume mounted to `/opengrok/src` should contain the projects you want to make searchable (in sub directories). You can use common revision control checkouts (git, svn, etc...) and OpenGrok will make history and blame information available.
37+
38+
By default, the index will be rebuild every ten minutes. You can adjust this
39+
time (in minutes) by passing the `REINDEX` environment variable:
40+
41+
docker run -d -e REINDEX=30 -v <path/to/your/src>:/opengrok/src -p 8080:8080 opengrok/docker:latest
42+
43+
Setting `REINDEX` to `0` will disable automatic indexing. You can manually trigger an reindex using docker exec:
44+
45+
docker exec <container> /scripts/index.sh
46+
47+
Setting `INDEXER_OPT` could pass extra options to opengrok-indexer. For example, you can run with:
48+
49+
docker run -d -e INDEXER_OPT="-i d:vendor" -v <path/to/your/src>:/opengrok/src -p 8080:8080 opengrok/docker:latest
50+
51+
To remove all the `*/vendor/*` files from the index. You can check the indexer options on
52+
53+
https://github.com/oracle/opengrok/wiki/Python-scripts-transition-guide
54+
55+
To avoid the mirroring step, set the `NOMIRROR` variable to non-empty value.
56+
57+
## OpenGrok Web-Interface
58+
59+
The container has OpenGrok as default web app installed (accessible directly from `/`). With the above container setup, you can find it running on
60+
61+
http://localhost:8080/
62+
63+
The first reindex will take some time to finish. Subsequent reindex will be incremental so will take signigicantly less time.
64+
65+
## Inspecting the container
66+
67+
You can get inside a container using the [command below](https://docs.docker.com/engine/reference/commandline/exec/):
68+
69+
```
70+
docker exec -it <container> bash
71+
```
72+
73+
Enjoy.
File renamed without changes.

dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ RUN rm -rf /usr/local/tomcat/webapps/* && \
4747
echo '<% response.sendRedirect("/"); %>' > "/usr/local/tomcat/webapps/source/index.jsp"
4848

4949
# disable all file logging
50-
ADD docker.logging.properties /usr/local/tomcat/conf/logging.properties
50+
ADD docker/logging.properties /usr/local/tomcat/conf/logging.properties
5151
RUN sed -i -e 's/Valve/Disabled/' /usr/local/tomcat/conf/server.xml
5252

5353
# add our scripts
54-
ADD scripts /scripts
54+
ADD docker /scripts
5555
RUN chmod -R +x /scripts
5656

5757
# run

0 commit comments

Comments
 (0)