version: '3'services:gerrit:container_name: gerrit-server-containerports:- "8080:8080"- "29418:29418"volumes:- "./var-gerrit-etc:/var/gerrit/etc"# NB: make host directory var-gerrit-etc writable by all users to avoid errors.# the user "gerrit" is not known to the host.environment:- CANONICAL_WEB_URL=http://gerrit.example.test:8080tty: true
On 29 Apr 2023, at 17:32, James Muir <jm...@crypto4a.com> wrote:The docker images available on docker hub are very useful for local testing. Thank-you for producing them.I have been using the image gerrit:3.7.2-ubuntu20. In its dockerfile, you can see that this image has five volumes, including "/var/gerrit/etc".It is convenient to bind mount "/var/gerrit/etc" from the container to a host path so I can edit config on the host and restart gerrit.Unfortunately, when I do that, I notice that gerrit goes through a different "first-run". The gerrit server does not display the welcome screen (which leads you to plugin selection), and the "admin" user is not automatically created.Is this intentional?
It must be that when gerrit starts up, it sees that the path /var/gerrit/etc exists (even though there are no files inside it) and decides to produce a different initial gerrit.conf file.Here is the compose file I am using if anyone is interested (I run it using podman). Note that there are good example compose files given on the docker hub page.version: '3'services:gerrit:container_name: gerrit-server-containerports:- "8080:8080"- "29418:29418"volumes:- "./var-gerrit-etc:/var/gerrit/etc"# NB: make host directory var-gerrit-etc writable by all users to avoid errors.# the user "gerrit" is not known to the host.environment:- CANONICAL_WEB_URL=http://gerrit.example.test:8080tty: true-James M
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CAM-GoEU%3DVPN8aKQHcJWa_uXQL7o%3DBh0wBmyfOtHeGQuk90dcRA%40mail.gmail.com.
It is convenient to bind mount "/var/gerrit/etc" from the container to a host path so I can edit config on the host and restart gerrit.Unfortunately, when I do that, I notice that gerrit goes through a different "first-run". The gerrit server does not display the welcome screen (which leads you to plugin selection), and the "admin" user is not automatically created.Is this intentional?Yes, because if you already have a configuration then it assumes you don’t need to initialise a new site from scratch.
On Sat, Apr 29, 2023 at 5:25 PM Luca Milanesio <luca.mi...@gmail.com> wrote:It is convenient to bind mount "/var/gerrit/etc" from the container to a host path so I can edit config on the host and restart gerrit.Unfortunately, when I do that, I notice that gerrit goes through a different "first-run". The gerrit server does not display the welcome screen (which leads you to plugin selection), and the "admin" user is not automatically created.Is this intentional?Yes, because if you already have a configuration then it assumes you don’t need to initialise a new site from scratch.But there is no existing configuration data. On the host, the directory ./var-gerrit-etc is empty. When the container starts, gerrit sees an existing but empty /var/gerrit/etc and that changes its behaviour.
James Muir schrieb am Samstag, 29. April 2023 um 23:51:20 UTC+2:On Sat, Apr 29, 2023 at 5:25 PM Luca Milanesio <luca.mi...@gmail.com> wrote:It is convenient to bind mount "/var/gerrit/etc" from the container to a host path so I can edit config on the host and restart gerrit.Unfortunately, when I do that, I notice that gerrit goes through a different "first-run". The gerrit server does not display the welcome screen (which leads you to plugin selection), and the "admin" user is not automatically created.Is this intentional?Yes, because if you already have a configuration then it assumes you don’t need to initialise a new site from scratch.But there is no existing configuration data. On the host, the directory ./var-gerrit-etc is empty. When the container starts, gerrit sees an existing but empty /var/gerrit/etc and that changes its behaviour.You probably had something in /var/gerrit/git/All-Projects.git (check Check https://github.com/GerritCodeReview/docker-gerrit/blob/master/ubuntu/22/entrypoint.sh to see when init is invoked in the container),
version: '3'services:gerrit:container_name: gerrit-server-containerports:- "8080:8080"- "29418:29418"
## uncomment the "volumes" section to bind mount /var/gerrit/etc to the host
## rm -rf var-gerrit-etc
## mkdir var-gerrit-etc && chmod a+w var-gerrit-etc
#volumes:# - "./var-gerrit-etc:/var/gerrit/etc"
Thanks for the pointer to "entrypoint.sh". I had been looking for a reference back to the repo used to build the docker image (I did not find one on gerrit hub).
Thanks for the pointer to "entrypoint.sh". I had been looking for a reference back to the repo used to build the docker image (I did not find one on gerrit hub).typo: I meant "docker hub" not "gerrit hub".
Björn Pedersen schrieb am Mittwoch, 3. Mai 2023 um 09:50:05 UTC+2:James Muir schrieb am Dienstag, 2. Mai 2023 um 16:32:51 UTC+2:Thanks for the pointer to "entrypoint.sh". I had been looking for a reference back to the repo used to build the docker image (I did not find one on gerrit hub).typo: I meant "docker hub" not "gerrit hub"./var/gerrit/git is marked as volume in the image, so if you restart it will be reusued (you should bin-mount it to a local directory for persistence anyway.) So probably it was not empty as you assumed.
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CAM-GoEXKGWzhj%3Drk3j4iTK0%3DULKfnnzaTGP9m7qjV-N0XdJ0Ww%40mail.gmail.com.
Yes, please raise a bug :-)
On Wed, May 3, 2023 at 9:43 AM Luca Milanesio <luca.mi...@gmail.com> wrote:Yes, please raise a bug :-)I am happy to do that, but I hoped someone else could confirm the behaviour first.
--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/CAM-GoEXafDrhrUD%3D00BjL1SaN6GFaxKyPw2tdDODwvhCQrb5JQ%40mail.gmail.com.
I am happy to do that, but I hoped someone else could confirm the behaviour first.I am not aware of any different behaviour when the volume is mounted externally, assuming you have the correct permissions in the file system of course.
On Wednesday, May 3, 2023 at 7:55:38 PM UTC+1 James Muir wrote:On Wed, May 3, 2023 at 2:33 PM <luca.mi...@gmail.com> wrote:I am happy to do that, but I hoped someone else could confirm the behaviour first.I am not aware of any different behaviour when the volume is mounted externally, assuming you have the correct permissions in the file system of course.By "confirm the behaviour", I meant that I hoped someone else could try out the compose file and confirm that they also see the buggy behaviour.I've run this locally with a local /tmp/etc directory containing the same gerrit.config as in the Docker image [1] and mounted as /var/gerrit/etc, it works as expected for me.P.S. If you start with an empty etc, you will get the default generated gerrit.config, which is different from the one backed in the Docker image at [1].
$ apt-get download gerrit$ mkdir deb && cd deb$ dpkg -x ../gerrit_3.8.0-0rc4_all.deb .$ find .../var./var/gerrit./var/gerrit/cache./var/gerrit/bin./var/gerrit/bin/gerrit.war./var/gerrit/etc./var/gerrit/etc/gerrit.config./var/gerrit/lib./var/gerrit/lib/out-of-the-box.jar./var/gerrit/git./var/gerrit/db./var/gerrit/index./var/gerrit/plugins./var/gerrit/plugins/uploadvalidator.jar./var/gerrit/plugins/avatars-gravatar.jar./usr./usr/share./usr/share/doc./usr/share/doc/gerrit./usr/share/doc/gerrit/changelog.gz