Merge branch 'stable-3.1'

* stable-3.1:
  Set Gerrit to 3.1.6
  Set Gerrit to 3.0.10
  Set Gerrit to 2.16.21
  Set Gerrit to 2.15.19
  Set Gerrit to 2.14.21
  Set version to 2.16.20
  Set Gerrit to 3.1.5
  Set Gerrit to 3.0.9
  Set version to 2.16.19
  Set version to 2.16.18

Change-Id: Ia3a7a42e98bc0a2e36425b301720767ca189727f
diff --git a/centos/7/entrypoint.sh b/centos/7/entrypoint.sh
deleted file mode 100755
index bf40fc8..0000000
--- a/centos/7/entrypoint.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash -e
-
-if [ ! -d /var/gerrit/git/All-Projects.git ] || [ "$1" == "init" ]
-then
-  echo "Initializing Gerrit site ..."
-  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"
-fi
-
-git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
-if [ ${HTTPD_LISTEN_URL} ];
-then
-  git config -f /var/gerrit/etc/gerrit.config httpd.listenUrl ${HTTPD_LISTEN_URL}
-fi
-
-if [ "$1" != "init" ]
-then
-  echo "Running Gerrit ..."
-  exec /var/gerrit/bin/gerrit.sh run
-fi
diff --git a/centos/7/.dockerignore b/centos/8/.dockerignore
similarity index 100%
rename from centos/7/.dockerignore
rename to centos/8/.dockerignore
diff --git a/centos/7/Dockerfile b/centos/8/Dockerfile
similarity index 88%
rename from centos/7/Dockerfile
rename to centos/8/Dockerfile
index 2851d47..803f61d 100644
--- a/centos/7/Dockerfile
+++ b/centos/8/Dockerfile
@@ -1,4 +1,4 @@
-FROM centos:7.7.1908
+FROM centos:8.1.1911
 MAINTAINER Gerrit Code Review Community
 
 # Add Gerrit packages repository
@@ -9,8 +9,8 @@
 # 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 initscripts && \
-    yum -y install java-1.8.0-openjdk && \
-    yum -y install gerrit-3.1.6-1 && \
+    yum -y install java-11-openjdk && \
+    yum -y install gerrit-3.2.0-1 && \
     /entrypoint.sh init && \
     rm -f /var/gerrit/etc/{ssh,secure}* && rm -Rf /var/gerrit/{static,index,logs,data,index,cache,git,db,tmp}/* && chown -R gerrit:gerrit /var/gerrit && \
     yum -y clean all
diff --git a/centos/7/Dockerfile-dev b/centos/8/Dockerfile-dev
similarity index 94%
rename from centos/7/Dockerfile-dev
rename to centos/8/Dockerfile-dev
index dfba96d..d4ec95d 100644
--- a/centos/7/Dockerfile-dev
+++ b/centos/8/Dockerfile-dev
@@ -1,4 +1,4 @@
-FROM centos:7.6.1810
+FROM centos:8.1.1911
 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"
@@ -6,10 +6,10 @@
 # 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 \
+    openssh-clients \
     initscripts \
     sudo \
-    java-1.8.0-openjdk \
+    java-11-openjdk \
     git && \
     yum -y clean all
 
diff --git a/centos/8/entrypoint.sh b/centos/8/entrypoint.sh
new file mode 100755
index 0000000..1fc4530
--- /dev/null
+++ b/centos/8/entrypoint.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -e
+
+export JAVA_OPTS='--add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED'
+
+if [ ! -d /var/gerrit/git/All-Projects.git ] || [ "$1" == "init" ]
+then
+  echo "Initializing Gerrit site ..."
+  java $JAVA_OPTS -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit
+  java $JAVA_OPTS -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"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.net=ALL-UNNAMED"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.lang.invoke=ALL-UNNAMED"
+fi
+
+git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
+if [ ${HTTPD_LISTEN_URL} ];
+then
+  git config -f /var/gerrit/etc/gerrit.config httpd.listenUrl ${HTTPD_LISTEN_URL}
+fi
+
+if [ "$1" != "init" ]
+then
+  echo "Running Gerrit ..."
+  exec /var/gerrit/bin/gerrit.sh run
+fi
diff --git a/ubuntu/18/entrypoint.sh b/ubuntu/18/entrypoint.sh
deleted file mode 100755
index bf40fc8..0000000
--- a/ubuntu/18/entrypoint.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash -e
-
-if [ ! -d /var/gerrit/git/All-Projects.git ] || [ "$1" == "init" ]
-then
-  echo "Initializing Gerrit site ..."
-  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"
-fi
-
-git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
-if [ ${HTTPD_LISTEN_URL} ];
-then
-  git config -f /var/gerrit/etc/gerrit.config httpd.listenUrl ${HTTPD_LISTEN_URL}
-fi
-
-if [ "$1" != "init" ]
-then
-  echo "Running Gerrit ..."
-  exec /var/gerrit/bin/gerrit.sh run
-fi
diff --git a/ubuntu/18/.dockerignore b/ubuntu/20/.dockerignore
similarity index 100%
rename from ubuntu/18/.dockerignore
rename to ubuntu/20/.dockerignore
diff --git a/ubuntu/18/Dockerfile b/ubuntu/20/Dockerfile
similarity index 90%
rename from ubuntu/18/Dockerfile
rename to ubuntu/20/Dockerfile
index 66f51e0..227adaf 100644
--- a/ubuntu/18/Dockerfile
+++ b/ubuntu/20/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:20.04
 MAINTAINER Gerrit Code Review Community
 
 # Add Gerrit packages repository
@@ -15,8 +15,8 @@
 
 # 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=3.1.6-1 && \
+RUN apt-get -y install openjdk-11-jdk
+RUN apt-get -y install gerrit=3.2.0-1 && \
     apt-mark hold gerrit && \
     /entrypoint.sh init && \
     rm -f /var/gerrit/etc/{ssh,secure}* && rm -Rf /var/gerrit/{static,index,logs,data,index,cache,git,db,tmp}/* && chown -R gerrit:gerrit /var/gerrit
diff --git a/ubuntu/18/Dockerfile-dev b/ubuntu/20/Dockerfile-dev
similarity index 96%
rename from ubuntu/18/Dockerfile-dev
rename to ubuntu/20/Dockerfile-dev
index a0a35ae..5b8e50a 100644
--- a/ubuntu/18/Dockerfile-dev
+++ b/ubuntu/20/Dockerfile-dev
@@ -1,4 +1,4 @@
-FROM ubuntu:18.04
+FROM ubuntu:20.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"
@@ -7,7 +7,7 @@
 RUN apt-get update && apt-get -y install \
     openssh-client \
     sudo \
-    openjdk-8-jdk \
+    openjdk-11-jdk \
     git && \
     rm -rf /var/lib/apt/lists/*
 
diff --git a/ubuntu/20/entrypoint.sh b/ubuntu/20/entrypoint.sh
new file mode 100755
index 0000000..1fc4530
--- /dev/null
+++ b/ubuntu/20/entrypoint.sh
@@ -0,0 +1,25 @@
+#!/bin/bash -e
+
+export JAVA_OPTS='--add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang.invoke=ALL-UNNAMED'
+
+if [ ! -d /var/gerrit/git/All-Projects.git ] || [ "$1" == "init" ]
+then
+  echo "Initializing Gerrit site ..."
+  java $JAVA_OPTS -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit
+  java $JAVA_OPTS -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"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.net=ALL-UNNAMED"
+  git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "--add-opens java.base/java.lang.invoke=ALL-UNNAMED"
+fi
+
+git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
+if [ ${HTTPD_LISTEN_URL} ];
+then
+  git config -f /var/gerrit/etc/gerrit.config httpd.listenUrl ${HTTPD_LISTEN_URL}
+fi
+
+if [ "$1" != "init" ]
+then
+  echo "Running Gerrit ..."
+  exec /var/gerrit/bin/gerrit.sh run
+fi