Merge branch 'stable-3.0' into stable-3.1

* stable-3.0:
  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

Change-Id: I6954ebd31942ba6d1b49d78b66c4d14a7a978007
diff --git a/README.md b/README.md
index 2fac467..094bad6 100644
--- a/README.md
+++ b/README.md
@@ -85,6 +85,14 @@
 
 Run ```docker-compose up``` to trigger the build and execution of your custom Gerrit docker setup.
 
+## Environment variables
+
+This is a list of available environment variables to change the Gerrit configuration:
+
+* `CANONICAL_WEB_URL`: Optional. Set the `gerrit.canonicalWebUrl` parameter in `gerrit.config`.
+Defaults to `http://<image_hostname>`
+* `HTTPD_LISTEN_URL`: Optional. Override the `httpd.listenUrl` parameter in `gerrit.config`.
+
 ## Using Gerrit in production
 
 When running Gerrit on Docker in production, it is a good idea to rely on a physical external
diff --git a/centos/7/Dockerfile b/centos/7/Dockerfile
index 0cc0072..8e919b1 100644
--- a/centos/7/Dockerfile
+++ b/centos/7/Dockerfile
@@ -1,4 +1,4 @@
-FROM centos:7.6.1810
+FROM centos:7.7.1908
 MAINTAINER Gerrit Code Review Community
 
 # Add Gerrit packages repository
@@ -10,7 +10,7 @@
 # (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.0.10-1 && \
+    yum -y install gerrit-3.1.5-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
@@ -18,6 +18,7 @@
 USER gerrit
 
 ENV CANONICAL_WEB_URL=
+ENV HTTPD_LISTEN_URL=
 
 # Allow incoming traffic
 EXPOSE 29418 8080
diff --git a/centos/7/Dockerfile-dev b/centos/7/Dockerfile-dev
index 2c2ee44..dfba96d 100644
--- a/centos/7/Dockerfile-dev
+++ b/centos/7/Dockerfile-dev
@@ -26,6 +26,7 @@
     git config --add -f /var/gerrit/etc/gerrit.config container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
 
 ENV CANONICAL_WEB_URL=
+ENV HTTPD_LISTEN_URL=
 
 # Allow incoming traffic
 EXPOSE 29418 8080
diff --git a/centos/7/entrypoint.sh b/centos/7/entrypoint.sh
index cb459b5..bf40fc8 100755
--- a/centos/7/entrypoint.sh
+++ b/centos/7/entrypoint.sh
@@ -9,6 +9,10 @@
 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
diff --git a/ubuntu/18/Dockerfile b/ubuntu/18/Dockerfile
index c009d15..35b57ec 100644
--- a/ubuntu/18/Dockerfile
+++ b/ubuntu/18/Dockerfile
@@ -16,7 +16,7 @@
 # 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.0.10-1 && \
+RUN apt-get -y install gerrit=3.1.5-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
@@ -24,6 +24,7 @@
 USER gerrit
 
 ENV CANONICAL_WEB_URL=
+ENV HTTPD_LISTEN_URL=
 
 # Allow incoming traffic
 EXPOSE 29418 8080
diff --git a/ubuntu/18/Dockerfile-dev b/ubuntu/18/Dockerfile-dev
index 761b9d6..a0a35ae 100644
--- a/ubuntu/18/Dockerfile-dev
+++ b/ubuntu/18/Dockerfile-dev
@@ -24,6 +24,7 @@
     git config --add -f /var/gerrit/etc/gerrit.config container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
 
 ENV CANONICAL_WEB_URL=
+ENV HTTPD_LISTEN_URL=
 
 # Allow incoming traffic
 EXPOSE 29418 8080
diff --git a/ubuntu/18/entrypoint.sh b/ubuntu/18/entrypoint.sh
index cb459b5..bf40fc8 100755
--- a/ubuntu/18/entrypoint.sh
+++ b/ubuntu/18/entrypoint.sh
@@ -9,6 +9,10 @@
 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