sakaicontrib / docker-sakai-builder

Some docker commands to get Sakai build and running 100% in docker
6 stars 7 forks source link

Fast Sakai Build

Tested on OSX, Linux(Ubuntu) and Windows Subsystem for Linux (Ubuntu+Windows Enterprise)

TODO:

Pre-requisites


If you already have this checked out and want to start fresh in this folder, run

docker stop sakai-mariadb; docker stop sakai-tomcat; docker rm sakai-mariadb; docker rm sakai-tomcat; docker rm sakai-build; git clean -f -d

Make sure you have a copy of Sakai in the sakai folder:

# You may also want to clone your fork/repo instead of the sakaiproject repo
git clone https://github.com/sakaiproject/sakai

Note at this point you can checkout and build another branch. These notes will only currently work with 19.x+ because of the tomcat version.

Now build it with maven in Docker!

Note: (This caches the artifacts at ~/.m2 deploys to /tomcat/deploy)

# May need to run this to clean up the deploy, run clean_deploy if the case
cd sakai
../sakai-dock.sh clean_deploy
../sakai-dock.sh build
cd ..

Start up MariaDB on port 53306. Remove database data if you already made one and want to clean it out! (Optional)

./sakai-dock.sh clean_data
./sakai-dock.sh mariadb

You can connect to mariadb to look around using a password of sakairoot. It takes up to 60 seconds for mariadb to fully come up so you might want to make sure this connection works before starting tomcat after starting mariadb.

mysql -h 127.0.0.1 -P 53306 -u root -p

Now startup tomcat!

# Remove if you already made a sakai-tomcat docker image and you want to a fresh one!
# docker rm sakai-tomcat
./sakai-dock.sh tomcat

Partial builds - Run from a subfolder

cd sakai/basiclti
../../sakai-dock.sh build

Sometimes it works but sometimes you also have to restart tomcat afer a build:

../../sakai-dock.sh tomcat

Custom Maven

You may need to build a custom Maven to get this to work from time to time. I've got a maven that includes git for instance.

cd mavenbuild
docker build . -t sakai:build

Then if you build with it -c option it will use this custom build instead of a default one.

References