[Evergreen-general] How to make changes to eg_vhost.conf in the Docker container?

Blake Graham-Henderson blake at mobiusconsortium.org
Fri Aug 11 10:32:26 EDT 2023


Linda,

The images that we've posted to dockerhub were not built with i18n 
turned on. That switch needs to have been set to "yes" during the build 
process. Which means, you'll probably want to build your own docker 
image instead of using the pre-made images.

Repo: https://github.com/mcoia/eg-docker

Building your own image is done like this:

1. Clone the git repository that does the work:

git clone https://github.com/mcoia/eg-docker.git

2. Customize the vars.yml to suit your needs

cd eg-docker/generic-dockerhub
vi vars.yml

The main two variables are:
   ubuntu_version: focal
   evergreen_version: 3.9.1

I'd change evergreen_version to: 3.11.1

You're also interested in this setting:
add_evergreen_language_support: no

If you change that setting to "yes" - it will cause the build to edit 
the eg_vhost.conf file during the build.

But* if you already have an eg_vhost.conf file that you would like to 
use, then leave that setting "no" and copy your eg_vhost.conf file 
directly into the generic-dockerhub folder.

You'll need to make one more change in order to incorporate your 
eg_vhost.conf:

# edit Dockerfile
vi Dockerfile

Add this line:
ADD eg_vhost.conf /egconfigs/eg_vhost.conf

Put that line right above this line:
RUN cd /egconfigs && ansible-playbook install_evergreen.yml -v -e 
"hosts=127.0.0.1"

so it should look like this:

.....
ADD vars.yml /egconfigs/vars.yml
ADD install_evergreen.yml /egconfigs/install_evergreen.yml
ADD evergreen_restart_services.yml /egconfigs/evergreen_restart_services.yml
ADD restart_post_boot.yml /egconfigs/restart_post_boot.yml
ADD eg_vhost.conf /egconfigs/eg_vhost.conf
RUN cd /egconfigs && ansible-playbook install_evergreen.yml -v -e 
"hosts=127.0.0.1"
ENTRYPOINT cd /egconfigs && ansible-playbook 
evergreen_restart_services.yml -vvvv -e "hosts=127.0.0.1" && while true; 
do sleep 1; done
#ENTRYPOINT while true; do sleep 1; done


Now, you're ready to build your own docker image. Like this:

docker build \
--add-host public.localhost:127.0.1.2 \
--add-host public:127.0.1.2 \
--add-host private.localhost:127.0.1.3 \
--add-host private:127.0.1.3 \
. --no-cache

You do need to be in the generic-dockerhub folder when you run that command

It will take about 15 minutes to complete. Once completed, Docker will 
report the sha hash of the image that you just built. You can see it 
with this command:

docker images

Now that you have your own image. You can start an Evergreen server from 
it. Like this:

|docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p 32:22 -p 
5433:5432 -h app.evergreen.com <your_new_image_sha_hash> Watch it boot 
up, and make sure it finishes. You will know that it finishes when you 
see the "PLAY RECAP" line, and there should be 0 fails. You can safely 
disconnect from the container leaving it running using the magic key 
combination: ctrl+pq (NOT ctrl+c, that will kill it) |

Now that I've said all of that, and you're going to supply your own eg_vhost.conf file, it might be faster to use the pre-built image from dockerhub, boot it up,
then replace the eg_vhost.conf file located in the container, and restart apache2.

So that would look like this:

1. Start docker with the community container:
|docker run -it -p 80:80 -p 443:443 -p 210:210 -p 6001:6001 -p 32:22 -p 
5433:5432 -h app.evergreen.com mobiusoffice/evergreen-ils:latest|

2. Wait for it to finish starting (look for that PLAY RECAP line, and confirm "0 fail"). Press ctrl+pq.

3. SSH into the container

ssh -p 32 user at localhost

the password is "password"

3a. Alternatively, you can attach to the container using "docker exec"

docker exec -it `docker ps -q` bash

4. Once you're on the shell of the container, you need to make your edits to:
/etc/apache2/eg_vhost.conf

note: vi is not installed in the container, you might have to install vi:

apt-get update && apt-get install -y vim

vi /etc/apache2/eg_vhost.conf
(make changes)

Save the file

5. Restart apache

/etc/init.d/apache2 restart

That should do it!

Good luck. Feel free to ask questions!


-Blake-
Conducting Magic
Will consume any data format
MOBIUS

On 8/11/2023 8:17 AM, Jane Sandberg via Evergreen-general wrote:
> That is very mysterious!
>
> These steps worked for me to add the 950 db seed in French within a 
> docker container:
>
> docker exec -it [container_name] bash
> cd /home/opensrf/repos/Evergreen
> make -f Open-ILS/src/extras/Makefile.install ubuntu-focal-translator
> su opensrf
> cd build/i18n
> mkdir locale
> make newpot
> make LOCALE=fr-CA updatepo
> exit # go back to root user
> cd /home/opensrf/repos/Evergreen/build/i18n && make LOCALE=fr-CA install
> su evergreen
> psql -f Open-ILS/src/sql/Pg/950.data.seed-values-fr-CA.sql
>
> El vie, 11 ago 2023 a la(s) 05:51, Linda Jansová 
> (linda.jansova at gmail.com) escribió:
>
>     Thank you very much, Jane!
>
>     We currently use the dev tag (but we may also try some other
>     non-dev tags as you have suggested :-); actually, it seems that
>     the language selector in the OPAC correctly appears after a couple
>     of reloads, then - for a couple of other reloads - it disappears
>     only to appear again after some more reloads ;-).
>
>     It definitely works in mysterious ways so far; we would probably
>     also need to add the 950 db seed with French (and Czech)
>     translations. Any ideas how to do this correctly?
>
>     Linda
>
>     On 8/11/23 14:25, Jane Sandberg wrote:
>>     Hi Linda,
>>
>>     What tag of the Evergreen container are you using?  I believe
>>     that the instructions under "Restarting Evergreen services" are
>>     only applicable to the "dev" tag (i.e. if you ran `docker run
>>     [...] mobiusoffice/evergreen-ils:dev`).  If you don't specify a
>>     tag, it defaults to the "latest" tag, which doesn't contain the
>>     file-based restart/recompile methods.
>>
>>     I typically use the non-dev tags, using the following steps to
>>     restart apache. Theoretically, they should work if you are using
>>     the dev tag too, but I haven't tried them:
>>
>>     1. docker ps # this will show the name of the running container
>>     2. docker exec -it [container_name] bash # this will provide a
>>     shell within the running container.  For example, if step 1 had
>>     mentioned that the running Evergreen container is named
>>     "peaceful_spence", it would be `docker exec -it peaceful_spence bash`
>>     3. apache2ctl restart # simply restarts apache. When I need to
>>     restart all services, I use `ansible-playbook
>>     /egconfigs/evergreen_restart_services.yml -e hosts="127.0.0.1"`
>>     instead.
>>
>>     Hope this helps,
>>
>>        -Jane
>>
>>     El vie, 11 ago 2023 a la(s) 04:28, Linda Jansová via
>>     Evergreen-general (evergreen-general at list.evergreen-ils.org)
>>     escribió:
>>
>>         Dear all,
>>
>>         We have just started experimenting with a Docker container
>>         (https://hub.docker.com/r/mobiusoffice/evergreen-ils), mainly
>>         to see whether it could help us identify what causes i18n
>>         issues reported in a separate thread (with a subject
>>         "Evergreen 3.11.0a not properly switching into Czech in the
>>         staff client").
>>
>>         At this point we are a bit stuck as we would like to make
>>         appropriate i18n changes to the eg_vhost.conf file and then
>>         make them visible both in the OPAC and in the staff client.
>>
>>         We have uncommented lines related to French translation (just
>>         to see if it works before we would make a deep dive into
>>         Czech) and restarted Evergreen as described at
>>         https://hub.docker.com/r/mobiusoffice/evergreen-ils (under
>>         the heading "Restarting Evergreen services") but it doesn’t
>>         seem to change anything in the OPAC.
>>
>>         How exactly should we proceed?
>>
>>         (Maybe a more specific piece of documentation that would
>>         answer our question is available somewhere; in that case,
>>         sharing a URL would be great :-).)
>>
>>         Thank you in advance!
>>
>>         Linda
>>
>>         _______________________________________________
>>         Evergreen-general mailing list
>>         Evergreen-general at list.evergreen-ils.org
>>         http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>>
>
>
> _______________________________________________
> Evergreen-general mailing list
> Evergreen-general at list.evergreen-ils.org
> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20230811/7c900660/attachment.htm>


More information about the Evergreen-general mailing list