On 2 May 2019, at 10:14, Peter Bruin <peterb...@gmail.com> wrote:I noticed that the startup scripts and plugins are not present in the latest docker image.These are normally installed during the building of the image.
This is what is in the 2.16.8 image: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"And this is the 3,0.0rc1 imageRUN git config -f /var/gerrit/etc/gerrit.config --add container.javaOptions "-Djava.security.egd=file:/dev/./urandom"
When I run the command in my docker-compose as part of the upgrade the installation will be upgraded but as the bin and plugin folder are not mapped the data will be lost during the next startup of the container.
I added the RUN java -jar /var/gerrit/bin/gerrit.war init --batch --install-all-plugins -d /var/gerrit to my local Dockerfile and that makes it work.
I am wondering if this change was on purpose or if I need to do something else during the initialization of the docker installation.
version: '3.4'
services:
gerrit:
build: .
ports:
- "29419:29419"
- "8082:8082"
#restart: unless-stopped
volumes:
- /external/gerrit3.0/etc:/var/gerrit/etc
- /external/gerrit3.0/git:/var/gerrit/git
- /external/gerrit3.0/index:/var/gerrit/index
- /external/gerrit3.0/cache:/var/gerrit/cache
- /external/gerrit3.0/logs:/var/gerrit/logs
- /external/gerrit3.0/.ssh:/var/gerrit/.ssh
networks:
default:
ipam:
driver: default
config:
- subnet: 172.29.1.0/24
FROM gerritcodereview/gerrit:3.0.0-rc1
COPY ./plugins/* /var/gerrit/plugins/
COPY ./static/* /var/gerrit/static/
COPY ./hooks/* /var/gerrit/hooks/
ENV CANONICAL_WEB_URL=https://gerrit.my_domain.net/r3/
Creating network "30_default" with the default driver
Creating 30_gerrit_1 ...
Creating 30_gerrit_1 ... done
Attaching to 30_gerrit_1
gerrit_1 | Running Gerrit ...
gerrit_1 | /entrypoint.sh: line 13: /var/gerrit/bin/gerrit.sh: No such file or directory
30_gerrit_1 exited with code 1#!/bin/bash -e
if [ ! -d /var/gerrit/git/All-Projects.git ]
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
fi
git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
echo "Running Gerrit ..."
exec /var/gerrit/bin/gerrit.sh run
On 2 May 2019, at 13:49, Peter Bruin <peterb...@gmail.com> wrote:Hi Luca,I just had a look at the entrypoint.sh script and it looks like the entrypoint.sh script works fine for new sites but will not work for existing sites as the All-Projects.git already exists.I think the original way of doing it was fine as it would create a default configuration in the image and populate the plugin and bin folder. However, this is now not done for existing sites and they will not be able to start.
Best Regards,Peter Bruin#!/bin/bash -e
if [ ! -d /var/gerrit/git/All-Projects.git ]
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
fi
git config -f /var/gerrit/etc/gerrit.config gerrit.canonicalWebUrl "${CANONICAL_WEB_URL:-http://$HOSTNAME}"
echo "Running Gerrit ..."
exec /var/gerrit/bin/gerrit.sh run
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
On 9 May 2019, at 14:52, Luca Milanesio <luca.mi...@gmail.com> wrote:On 2 May 2019, at 13:49, Peter Bruin <peterb...@gmail.com> wrote:Hi Luca,I just had a look at the entrypoint.sh script and it looks like the entrypoint.sh script works fine for new sites but will not work for existing sites as the All-Projects.git already exists.I think the original way of doing it was fine as it would create a default configuration in the image and populate the plugin and bin folder. However, this is now not done for existing sites and they will not be able to start.Oh yes, this is because the run of the init step is done *ONLY* if the All-Projects.git doesn't exist.Let address this and I will fix it before the 3.0.0-rc3 packaging for Docker.