| FROM centos:7.3.1611 |
| MAINTAINER Gerrit Code Review Community |
| |
| # Allow remote connectivity and sudo |
| RUN yum -y install openssh-client initscripts sudo |
| |
| # Add Gerrit packages repository |
| RUN rpm -i https://gerritforge.com/gerritforge-repo-1-2.noarch.rpm |
| |
| # Install OpenJDK and Gerrit in two subsequent transactions |
| # (pre-trans Gerrit script needs to have access to the Java command) |
| RUN yum -y install java-1.8.0-openjdk |
| RUN yum -y install gerrit-2.14.13 |
| |
| USER gerrit |
| RUN java -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit |
| RUN java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit |
| RUN git config -f /var/gerrit/etc/gerrit.config container.javaOptions "-Djava.security.egd=file:/dev/./urandom" |
| |
| # Allow incoming traffic |
| EXPOSE 29418 8080 |
| |
| VOLUME ["/var/gerrit/git", "/var/gerrit/index", "/var/gerrit/cache", "/var/gerrit/db", "/var/gerrit/etc"] |
| |
| # Start Gerrit |
| CMD /var/gerrit/bin/gerrit.sh start && tail -f /var/gerrit/logs/error_log |