Merge branch 'stable-2.15' into stable-2.16

* stable-2.15:
  Set Gerrit to 2.15.10
  Set Gerrit to 2.15.9
  Set Gerrit to 2.13.12
  Set Gerrit to 2.14.18
  Set Gerrit to 2.15.8
  Set Gerrit to 2.15.7
  Set Gerrit to 2.14.17
  Set Gerrit to 2.15.6
  Set Gerrit to 2.14.16
  Upgrade CentOS to 7.5.1804
  Add support for Gerrit 2.13.11 on ubuntu 14.04 and centos

Change-Id: Ia821612383f163417f2dfd8c91977e909509616a
diff --git a/.github/ISSUE_TEMPLATE/raising-issues.md b/.github/ISSUE_TEMPLATE/raising-issues.md
new file mode 100644
index 0000000..b620214
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/raising-issues.md
@@ -0,0 +1,14 @@
+---
+name: Raising issues
+about: Important Notice on how to raise issues
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+Issues submission is done through [Gerrit Issue Tracker](https://bugs.chromium.org/p/gerrit/issues/list).
+Unfortunately, we cannot accept or follow-up issues raised on GitHub.
+This is a read-only project replica and is not monitored on a regular basis.
+
+Thank you in advance for your understanding.
diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md
new file mode 100644
index 0000000..19c0f3a
--- /dev/null
+++ b/PULL_REQUEST_TEMPLATE.md
@@ -0,0 +1,7 @@
+# Important Notice
+
+Patch submission and review is done through [Gerrit Code Review](https://gerrit-review.googlesource.com).
+Unfortunately we cannot pull your code as a Pull Request.
+
+__NO REVIEWS OR DISCUSSIONS will happen on GitHub__, all the code collaboration
+will take place on Gerrit.
diff --git a/README.md b/README.md
index da3b2ec..e5eb1b0 100644
--- a/README.md
+++ b/README.md
@@ -25,11 +25,40 @@
 Starting from Ver. 2.14, a new introduction screen guides you through the basics of Gerrit
 and allows installing additional plugins downloaded from [Gerrit CI](https://gerrit-ci.gerritforge.com).
 
+## Build docker image
+
+For docker images that contain released Gerrit versions, tags exist in this git repository pointing
+to a state of the repository, where this version of Gerrit (e.g. 2.15.4) is referenced in the
+Dockerfiles. To build such a docker image for development purposes, checkout the respective version
+tag, e.g.:
+
+```
+git checkout v2.15.4
+```
+
+Navigate to either `./centos/7` or `./ubuntu/16` to build the centos- or ubuntu-based docker image,
+respectively. Then run:
+
+```
+docker build -t gerritcodereview/gerrit:$(git describe) .
+```
+
+To build an image containing a development build of Gerrit, e.g. to test a change, run the following
+command instead:
+
+```
+docker build --build-arg GERRIT_WAR_URL="<url>" -t gerritcodereview/gerrit -f Dockerfile-dev .
+```
+
+The `<url>` passed to the `GERRIT_WAR_URL`-build argument has to point to a Gerrit-`.war`-file.
+The build argument defaults to the URL pointing to the last successful build of the Gerrit master
+branch on the [Gerrit CI](https://gerrit-ci.gerritforge.com).
+
 ## Using persistent volumes
 
 Use docker persistent volumes to keep Gerrit data across restarts.
-See below a sample docker-compose.yaml for persisting the H2 Database, Lucene indexes, Caches and
-Git repositories.
+See below a sample docker-compose.yaml per externally-mounted Lucene indexes,
+Caches and Git repositories.
 
 Example of /docker-compose.yaml
 
@@ -41,7 +70,6 @@
     image: gerritcodereview/gerrit
     volumes:
        - git-volume:/var/gerrit/git
-       - db-volume:/var/gerrit/db
        - index-volume:/var/gerrit/index
        - cache-volume:/var/gerrit/cache
     ports:
@@ -50,7 +78,6 @@
 
 volumes:
   git-volume:
-  db-volume:
   index-volume:
   cache-volume:
 ```
@@ -62,12 +89,11 @@
 
 When running Gerrit on Docker in production, it is a good idea to rely on a physical external
 storage with much better performance and reliability than the Docker's internal AUFS, and an external
-configuration directory for better change management traceability.
+configuration directory for better change management traceability. Additionally,
+you may want to use a proper external authentication.
 
-Additionally, you may want to replace H2 with a more robust DBMS like PostgreSQL and an external
-authentication system such as LDAP.
-
-See below a more advanced example of docker-compose.yaml with PostgreSQL and OpenLDAP (from Osixia's DockerHub).
+See below a more advanced example of docker-compose.yaml with OpenLDAP
+(from Osixia's DockerHub).
 
 Example of /docker-compose.yaml assuming you have an external directory available as /external/gerrit
 
@@ -80,26 +106,16 @@
     ports:
       - "29418:29418"
       - "80:8080"
-    links:
-      - postgres
     depends_on:
-      - postgres
       - ldap
     volumes:
-     - /external/gerrit/etc:/var/gerrit/etc
-     - /external/gerrit/git:/var/gerrit/git
-     - /external/gerrit/index:/var/gerrit/index
-     - /external/gerrit/cache:/var/gerrit/cache
-#    entrypoint: java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit
-
-  postgres:
-    image: postgres:9.6
+      - /external/gerrit/etc:/var/gerrit/etc
+      - /external/gerrit/git:/var/gerrit/git
+      - /external/gerrit/index:/var/gerrit/index
+      - /external/gerrit/cache:/var/gerrit/cache
     environment:
-      - POSTGRES_USER=gerrit
-      - POSTGRES_PASSWORD=secret
-      - POSTGRES_DB=reviewdb
-    volumes:
-      - /external/gerrit/postgres:/var/lib/postgresql/data
+      - CANONICAL_WEB_URL=http://localhost
+#    entrypoint: java -jar /var/gerrit/bin/gerrit.war init -d /var/gerrit
 
   ldap:
     image: osixia/openldap
@@ -128,10 +144,8 @@
   canonicalWebUrl = http://localhost
 
 [database]
-  type = postgresql
-  hostname = postgres
-  database = reviewdb
-  username = gerrit
+  type = h2
+  database = db/ReviewDB
 
 [index]
   type = LUCENE
@@ -166,9 +180,6 @@
 
 Example of /external/gerrit/etc/secure.config
 ```
-[database]
-  password = secret
-
 [ldap]
   password = secret
 ```
@@ -182,18 +193,7 @@
 
 The initialization can be done as a one-off operation before starting all containers.
 
-#### Step-1: Create the PostgreSQL ReviewDB
-
-Start the postgres image standalone using docker compose:
-
-```
-docker-compose up -d postgres
-docker-compose logs -f postgres
-```
-
-Wait until you see in the output a message like: "database system is ready to accept connections"
-
-#### Step-2: Run Gerrit docker init setup from docker
+#### Step-1: Run Gerrit docker init setup from docker
 
 Uncomment in docker-compose.yaml the Gerrit init step entrypoint and run Gerrit with docker-compose
 in foreground.
@@ -205,7 +205,7 @@
 Wait until you see in the output the message ```Initialized /var/gerrit``` and then the container
 will exit.
 
-#### Step-3: Start Gerrit in daemon mode
+#### Step-2: Start Gerrit in daemon mode
 
 Comment out the gerrit init entrypoint in docker-compose.yaml and start all the docker-compose nodes:
 
@@ -251,4 +251,4 @@
 Refer to Gerrit Documentation at http://localhost/Documentation/index.html for more information on
 how to configure, administer and use Gerrit Code Review.
 
-For a full list of Gerrit Code Review resources, refer to the [Gerrit Code Review home page](https://www.gerritcodereview.com)
\ No newline at end of file
+For a full list of Gerrit Code Review resources, refer to the [Gerrit Code Review home page](https://www.gerritcodereview.com)
diff --git a/centos/7/Dockerfile b/centos/7/Dockerfile
index f70493c..504de4a 100644
--- a/centos/7/Dockerfile
+++ b/centos/7/Dockerfile
@@ -1,20 +1,21 @@
 FROM centos:7.5.1804
 MAINTAINER Gerrit Code Review Community
 
-RUN yum -y install 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
+# Install OS pre-prequisites, 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.15.10-1  && rm -f /var/gerrit/logs/*
+RUN yum -y install initscripts && \
+    yum -y install java-1.8.0-openjdk && \
+    yum -y install gerrit-2.16.5-1  && rm -Rf /var/gerrit/{logs,tmp}/* && rm -Rf /var/gerrit/.gerritcodereview && \
+    yum -y clean all
 
 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"
+
+RUN java -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit && \
+    java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit && \
+    git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
 
 ENV CANONICAL_WEB_URL=
 
@@ -24,6 +25,6 @@
 VOLUME ["/var/gerrit/git", "/var/gerrit/index", "/var/gerrit/cache", "/var/gerrit/db", "/var/gerrit/etc"]
 
 # Start Gerrit
-CMD git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME:8080/}" && \
+CMD git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}" && \
     git config -f /var/gerrit/etc/gerrit.config noteDb.changes.autoMigrate true && \
         /var/gerrit/bin/gerrit.sh run
diff --git a/centos/7/Dockerfile-dev b/centos/7/Dockerfile-dev
new file mode 100644
index 0000000..0f19627
--- /dev/null
+++ b/centos/7/Dockerfile-dev
@@ -0,0 +1,38 @@
+FROM centos:7.5.1804
+MAINTAINER Gerrit Code Review Community
+
+ARG GERRIT_WAR_URL="https://gerrit-ci.gerritforge.com/view/Gerrit/job/Gerrit-bazel-master/lastSuccessfulBuild/artifact/gerrit/bazel-bin/release.war"
+
+# Allow remote connectivity and sudo and install OpenJDK and Git
+# (pre-trans Gerrit script needs to have access to the Java command)
+RUN yum -y install \
+    openssh-client \
+    initscripts \
+    sudo \
+    java-1.8.0-openjdk \
+    git && \
+    yum -y clean all
+
+RUN adduser -m gerrit --home-dir /home/gerrit && \
+    mkdir -p /var/gerrit/bin && \
+    chown -R gerrit /var/gerrit
+USER gerrit
+ADD --chown=gerrit $GERRIT_WAR_URL  /var/gerrit/bin/gerrit.war
+RUN mkdir -p /var/gerrit/etc && \
+    touch /var/gerrit/etc/gerrit.config && \
+    git config -f /var/gerrit/etc/gerrit.config auth.type DEVELOPMENT_BECOME_ANY_ACCOUNT && \
+    java -jar /var/gerrit/bin/gerrit.war init --dev --batch --install-all-plugins --no-auto-start -d /var/gerrit && \
+    java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit && \
+    git config --add -f /var/gerrit/etc/gerrit.config container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
+
+ENV CANONICAL_WEB_URL=
+
+# 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 git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME:8080/}" && \
+    git config -f /var/gerrit/etc/gerrit.config noteDb.changes.autoMigrate true && \
+        /var/gerrit/bin/gerrit.sh run
\ No newline at end of file
diff --git a/ubuntu/16/Dockerfile b/ubuntu/16/Dockerfile
index f9ea613..21121c0 100644
--- a/ubuntu/16/Dockerfile
+++ b/ubuntu/16/Dockerfile
@@ -12,12 +12,12 @@
 # Install OpenJDK and Gerrit in two subsequent transactions
 # (pre-trans Gerrit script needs to have access to the Java command)
 RUN apt-get -y install openjdk-8-jdk
-RUN apt-get -y install gerrit=2.15.10-1 && rm -f /var/gerrit/logs/*
+RUN apt-get -y install gerrit=2.16.5-1 && rm -f /var/gerrit/logs/*
 
 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"
+RUN git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
 
 ENV CANONICAL_WEB_URL=
 
@@ -27,6 +27,6 @@
 VOLUME ["/var/gerrit/git", "/var/gerrit/index", "/var/gerrit/cache", "/var/gerrit/db", "/var/gerrit/etc"]
 
 # Start Gerrit
-CMD git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME:8080/}" && \
+CMD git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}" && \
     git config -f /var/gerrit/etc/gerrit.config noteDb.changes.autoMigrate true && \
         /var/gerrit/bin/gerrit.sh run
diff --git a/ubuntu/16/Dockerfile-dev b/ubuntu/16/Dockerfile-dev
new file mode 100644
index 0000000..5b8cfae
--- /dev/null
+++ b/ubuntu/16/Dockerfile-dev
@@ -0,0 +1,36 @@
+FROM ubuntu:16.04
+MAINTAINER Gerrit Code Review Community
+
+ARG GERRIT_WAR_URL="https://gerrit-ci.gerritforge.com/view/Gerrit/job/Gerrit-bazel-master/lastSuccessfulBuild/artifact/gerrit/bazel-bin/release.war"
+
+# Install OpenJDK and Git and allow remote connectivity and sudo
+RUN apt-get update && apt-get -y install \
+    openssh-client \
+    sudo \
+    openjdk-8-jdk \
+    git && \
+    rm -rf /var/lib/apt/lists/*
+
+RUN adduser --disabled-password --gecos "" gerrit --home /home/gerrit && \
+    mkdir -p /var/gerrit/bin && \
+    chown -R gerrit /var/gerrit
+USER gerrit
+ADD --chown=gerrit $GERRIT_WAR_URL  /var/gerrit/bin/gerrit.war
+RUN mkdir -p /var/gerrit/etc && \
+    touch /var/gerrit/etc/gerrit.config && \
+    git config -f /var/gerrit/etc/gerrit.config auth.type DEVELOPMENT_BECOME_ANY_ACCOUNT && \
+    java -jar /var/gerrit/bin/gerrit.war init --dev --batch --install-all-plugins -d /var/gerrit && \
+    java -jar /var/gerrit/bin/gerrit.war reindex -d /var/gerrit && \
+    git config --add -f /var/gerrit/etc/gerrit.config container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
+
+ENV CANONICAL_WEB_URL=
+
+# 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 git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME:8080/}" && \
+    git config -f /var/gerrit/etc/gerrit.config noteDb.changes.autoMigrate true && \
+        /var/gerrit/bin/gerrit.sh run