Commit 9611bf66 authored by hdeadman's avatar hdeadman

minor docker updates

exec java in docker entrypoint so java is pid 1
having java be pid 1 allows for stack dump via:
  docker kill --signal=QUIT cas

put docker image in gradle.propertiees so non-slim can be used if tools
like jstack are desired
parent 1896a3e4
......@@ -5,6 +5,7 @@
@set CONFIG_DIR=\etc\cas\config
@set SHELL_DIR=build\libs
@set BUILD_DIR=build\libs
@set DOCKER_ORG=org.apereo.cas
@if "%PROFILES%" == "" @set PROFILES=standalone
@rem Call this script with DNAME and CERT_SUBJ_ALT_NAMES already set to override
......@@ -36,6 +37,8 @@
@if "%1" == "dependencies" call:dependencies
@if "%1" == "dockerimage" call:dockerimage
@if "%1" == "dockerrun" call:dockerrun
@if "%1" == "dockerrunsh" call:dockerrunsh
@if "%1" == "dockerexecsh" call:dockerexecsh
@rem function section starts here
@goto :EOF
......@@ -49,7 +52,7 @@
@goto :EOF
:help
@echo "Usage: build.cmd [copy|clean|package|refresh|run|debug|gencert|dockerimage|dockerrun] [optional extra args for gradle]"
@echo "Usage: build.cmd [copy|clean|package|refresh|run|debug|gencert|dockerimage|dockerrunsh|dockerexecsh] [optional extra args for gradle]"
@echo "To get started on a clean system, run 'build.cmd gencert && build.cmd copy && build.cmd run'"
@echo "Note that using the copy or gencert arguments will create and/or overwrite the %CAS_DIR% which is outside this project"
@goto :EOF
......@@ -83,9 +86,20 @@
:dockerrun
docker stop cas
docker rm cas
docker run --name cas org.apereo.cas/cas:latest
docker run --name cas %DOCKER_ORG%/cas:latest
@goto :EOF
:dockerrunsh
@rem run image to look around, delete container on exit
docker run --rm -it --entrypoint /bin/sh %DOCKER_ORG%/cas:latest
@goto :EOF
:dockerexecsh
@rem exec into runing container to look around, run jstack, check config, etc
docker exec -it cas /bin/sh
@goto :EOF
:gencert
where /q keytool
if ERRORLEVEL 1 (
......
......@@ -95,7 +95,7 @@ dependencies {
jib {
from {
image = "adoptopenjdk/openjdk11:jdk11-alpine-nightly-slim"
image = project.baseDockerImage
}
to {
image = "${project.group}/${project.name}"
......
......@@ -14,3 +14,7 @@ targetCompatibility=11
# Location of the downloaded CAS shell JAR
shellDir=build/libs
# use without "-slim" in tag name if you want tools like jstack, adds about 100MB to image size
# (https://hub.docker.com/r/adoptopenjdk/openjdk11/tags/)
baseDockerImage=adoptopenjdk/openjdk11:jdk11-alpine-nightly-slim
\ No newline at end of file
......@@ -19,4 +19,4 @@ mv docker/cas/services/*.* /etc/cas/services 2>/dev/null
#ls -R /etc/cas
echo -e "\nRunning CAS..."
java -Xms512m -Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -jar docker/cas/war/cas.war
exec java -Xms512m -Xmx2048M -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -jar docker/cas/war/cas.war
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment