|
1 week ago | |
---|---|---|
dists | 1 week ago | |
env | 6 months ago | |
files | 1 month ago | |
kibana | 1 year ago | |
.gitignore | 3 years ago | |
.gitlab-ci.yml | 3 months ago | |
Jenkinsfile | 3 months ago | |
LICENSE | 3 years ago | |
README.md | 2 months ago | |
docker-compose-build.yml | 3 weeks ago | |
docker-compose.es5.yml | 8 months ago | |
docker-compose.es6.yml | 1 year ago | |
docker-compose.es7.yml | 8 months ago | |
docker-compose.kibana.yml | 1 year ago | |
docker-compose.mariadb_d9.yml | 1 year ago | |
docker-compose.mariadb_d10.yml | 1 year ago | |
docker-compose.mariadb_d11.yml | 7 months ago | |
docker-compose.mariadb_latest.yml | 1 year ago | |
docker-compose.mysql8.0.yml | 1 year ago | |
docker-compose.persistent.yml | 1 year ago | |
docker-compose.plugin.yml | 1 year ago | |
docker-compose.yml | 3 weeks ago |
This project provides a dockered solution for running a Koha ILS development environment inside Docker containers.
It is built using the package install with the needed tweaks (including koha-gitify) in order to create such environment.
The docker-compose.yml file is self explanatory.
$ sudo usermod -aG docker ${USER}
$ mkdir ~/git ; cd ~/git
$ git clone https://gitlab.com/koha-community/koha-testing-docker.git
$ cd koha-testing-docker
Requirement: The SYNC_REPO variable needs to be defined and contain the full path for a Koha’s git repository clone.
This can be made permanent by adding the following to your user’s .bashrc (using the correct path to your Koha clone):
# ENV variables for kohadevbox
export SYNC_REPO="/home/user/kohaclone"
export LOCAL_USER_ID=$(id -u)
Note you will need to log out and log back in (or start a new terminal window) for this to take effect.
Copy the env/defaults.env file into the running directory:
$ cp env/defaults.env .env
Some variables need to be set to run this:
$ export SYNC_REPO=/path/to/kohaclone
$ export LOCAL_USER_ID=$(id -u)
This project includes some handy aliases for easy startup, opening a shell inside the Koha container and stopping everything:
Alias | Function |
---|---|
ku | Start the whole thing, using MariaDB 10.1 with Debian 9 |
ku-es5 | As above, plus ES5 |
ku-es6 | As above, replacing ES5 with ES6 |
ku-es7 | As above, replacing ES6 with ES7 |
ku-mdb | Start the whole thing, using latest MariaDB with Debian 9 |
ku-md9 | Start the whole thing, using MariaDB matched to Debian 9 |
ku-md10 | Start the whole thing, using MariaDB matched to Debian 10 |
ku-my8 | Start the whole thing, using latest MySQL with Debian 9 |
kp | Start the whole thing, with mysql persistence |
kup | Start the env, plugin development set 1 2 |
kk | Start the whole thing, with kibana |
kpk | Start the whole thing, with mysql persistence and kibana |
kd | Stop the whole thing |
kshell | Opens a shell inside the Koha container |
In order to use this aliases you need to edit your ~/.bashrc ( or ~/.profile if using Git for Windows ) file adding:
export KOHA_TESTING_DOCKER_HOME=/path/to/your/koha-testing-docker/clone
source ${KOHA_TESTING_DOCKER_HOME}/files/bash_aliases
$ docker-compose -p koha up
Alternatively, you can have it run all the tests and exit, like this:
$ export RUN_TESTS_AND_EXIT="yes"
# Optionally you can add COVERAGE=1 so the tests generate coverage data
# Optionally you can add CPAN=1 to pull the latest versions of perl dependancies directly from cpan
$ docker-compose -p koha up --abort-on-container-exit
$ docker-compose -f docker-compose.yml pull
If you need to keep the DB between your different uses of the containers, you can run
$ docker-compose -f docker-compose.yml -f docker-compose.persistent.yml -p koha up
Alias: kp
If you would like to use Kibana for testing/interacting with ES directly you can include an extra compose file
$ docker-compose -f docker-compose.yml -f docker-compose.kibana.yml -p koha up
Alias: kk
It is possible to combine this with persistence
$ docker-compose -f docker-compose.yml -f docker-compose.persistent.yml -f docker-compose.kibana.yml -p koha up
Alias: kpk
Getting into the koha container:
$ docker exec -it koha_koha_1 bash
Note: the first koha should match the -p parameter used in docker-compose up
Alias: kshell
Once you are left on the shell, you can run Koha tests as you would on KohaDevBox:
$ sudo koha-shell kohadev
$ cd koha
$ prove t/db_dependent/Search.t
The IP address of the web server in your docker group will be variable. Once you are in with SSH, issuing a
$ip a
should display the IP address of the webserver. At this point the web interface of Koha can be accessed by going to http://:8080 for the OPAC http://:8081 for the Staff interface.
The Koha container ships with some aliases to improve productivity. They are divided in two, depending on the user in which the alias is defined.
Aliases for the instance user require that you start a shell with that user in order to be used. This is done like this:
$ kshell
Note: it is recommended to run start_plack_debug on a separate terminal because it doesn’t free the prompt until the process is stopped.
[*] reset_all actually:
In order for Elasticsearch to run, changes to the host OS need to be made. Please read the official docs
Increase vm.max_map_count kernel setting to at least 262144:
# Increase vm.max_map_count
$ sudo sysctl -w vm.max_map_count=262144
# Make it permanent
$ sudo echo "vm.max_map_count=262144" >> /etc/sysctl.conf
$ screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty
# login with root and no password
$ sysctl -w vm.max_map_count=262144
If the screen command doesn’t work try: find ~/Library/Containers/com.docker.docker/Data/ -name ‘tty’