WeBWorK Main Forum

How update pg and OPL in Docker version of WeBWorK 2.15

How update pg and OPL in Docker version of WeBWorK 2.15

by Murray Eisenberg -
Number of replies: 1

To what directory should I cd, and what command should I use, in order to upgrade pg and OPL for the Docker version of WeBWorK 2.15?

There are various places on this website where upgrading/updating instructions are given, but none seem to fit the directory structure for the Docker-installed version.

For example, at https://webwork.maa.org/wiki/Open_Problem_Library#Updating_the_OPL, it gives instructions:

`$ cd /opt/webwork/libraries/webwork-open-problem-library`

`$ git pull`

`$ OPL-update`

But I find is no such directory /opt/webwork/libraries/webwork-open-problem-library. Rather, in Terminal I started WeBWork with command `cd ~/Sites/webwork/webwork2; docker-compose up -d`. And now at tree level webwork, I see directories `DATA`, `bin`, `clients`, `conf,` `docker-config`, `htdocs`, lib`, etc.

In reply to Murray Eisenberg

Re: How update pg and OPL in Docker version of WeBWorK 2.15

by Nathan Wallach -

Updating PG:

1. I think the "docker way" to get an updated version of PG from the main repository would to be to build a new docker image ("docker-compose build"). You could modify the Dockerfile to pull in PG from a different repository or branch, but to get it into a "fixed" Docker image, you would need to build the new image.

2. If you just want to handle local changes, you would modify docker-compose.yml to mount your local directory over what is inside the image, and then whatever is there will be used. (Most files are cached into the Apache process, so an apache restart or docker-compose down/up cycle is needed when files changed.)


OPL: In the current Docker setup it is stored on a persistent storage volume, so the following should work:

docker container exec -it webwork2_app_1 bash   # Get a shell inside a running Docker container

cd libraries/webwork-open-problem-library/

git fetch

git checkout master

git pull

# Maybe also do

#          cd /opt/webwork/webwork2/ 

#            bin/OPL-update