From bccccb09b0cf9c21cefc891ef788d9fa9da95df8 Mon Sep 17 00:00:00 2001 From: Barry d'Hoine Date: Tue, 10 Dec 2024 21:52:17 +0100 Subject: [PATCH] Update docker image jmv properties and fix stop script --- Dockerfile | 11 +++++----- README.md | 6 +++--- aem-start.sh | 6 ++++-- aem/default/etc/aem.yml | 46 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 aem/default/etc/aem.yml diff --git a/Dockerfile b/Dockerfile index 757cdeb..1a254c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -FROM azul/zulu-openjdk:11-jre-headless as installer +FROM azul/zulu-openjdk:11-jre-headless AS installer -ARG AEMC_VERSION=2.0.1 +ARG AEMC_VERSION=2.0.3 ARG TARGETOS=linux ARG TARGETARCH=amd64 @@ -23,13 +23,14 @@ EXPOSE ${PORT} WORKDIR /opt -COPY aem-start.sh /usr/local/bin/aem-start -RUN chmod +x /usr/local/bin/aem-start - COPY aem-sdk-artifacts/aem-sdk-*.zip aem/home/lib/ +COPY aem/default/etc/aem.yml aem/default/etc/aem.yml RUN aem instance --instance-${RUNMODE} launch && aem instance down HEALTHCHECK CMD /usr/local/bin/aem instance --instance-${RUNMODE} await +COPY aem-start.sh /usr/local/bin/aem-start +RUN chmod +x /usr/local/bin/aem-start + CMD ["/usr/local/bin/aem-start"] diff --git a/README.md b/README.md index 9d5caca..a9de016 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ docker build . -t aem-sdk:author And run the image ```shell -docker run -p 4502:4502 aem-sdk:author +docker run -p 4502:4502 -p 5005:14502 aem-sdk:author ``` To build the publish image, you need to specify the correct build arguments. @@ -58,5 +58,5 @@ docker build \ And run the image ```shell -docker run -p 4503:4503 aem-sdk:publish -``` \ No newline at end of file +docker run -p 4503:4503 -p 5006:14504 aem-sdk:publish +``` diff --git a/aem-start.sh b/aem-start.sh index a3bcacd..569d0b6 100644 --- a/aem-start.sh +++ b/aem-start.sh @@ -5,8 +5,10 @@ aem_stop() { exit 0 } -trap aem_stop INT TERM +trap aem_stop INT TERM EXIT + +ln -sf /proc/1/fd/1 /opt/aem/home/var/instance/${RUNMODE}/crx-quickstart/logs/error.log /usr/local/bin/aem instance --instance-${RUNMODE} start -tail -F /opt/aem/home/var/instance/${RUNMODE}/crx-quickstart/logs/error.log +(cat) \ No newline at end of file diff --git a/aem/default/etc/aem.yml b/aem/default/etc/aem.yml new file mode 100644 index 0000000..7ce5a53 --- /dev/null +++ b/aem/default/etc/aem.yml @@ -0,0 +1,46 @@ +instance: + config: + local_author: + active: [[.Env.AEM_AUTHOR_ACTIVE | default true ]] + http_url: [[.Env.AEM_AUTHOR_HTTP_URL | default "http://127.0.0.1:4502" ]] + user: [[.Env.AEM_AUTHOR_USER | default "admin" ]] + password: [[.Env.AEM_AUTHOR_PASSWORD | default "admin" ]] + run_modes: [ local ] + jvm_opts: + - -server + - -Xms2048m + - -Xmx2048m + - -Djava.awt.headless=true + - -XX:+CMSClassUnloadingEnabled + - -XX:+UseParallelGC + - --add-opens=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED + - --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED + - --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED + - --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED + - --add-opens=java.base/java.lang=ALL-UNNAMED + - --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED + - --add-opens=java.base/java.net=ALL-UNNAMED + - -Dnashorn.args=--no-deprecation-warning" + - -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=[[.Env.AEM_AUTHOR_DEBUG_ADDR | default "0.0.0.0:14502" ]] + local_publish: + active: [[.Env.AEM_PUBLISH_ACTIVE | default true ]] + http_url: [[.Env.AEM_PUBLISH_HTTP_URL | default "http://127.0.0.1:4503" ]] + user: [[.Env.AEM_PUBLISH_USER | default "admin" ]] + password: [[.Env.AEM_PUBLISH_PASSWORD | default "admin" ]] + run_modes: [ local ] + jvm_opts: + - -server + - -Xms2048m + - -Xmx2048m + - -XX:+CMSClassUnloadingEnabled + - -XX:+UseParallelGC + - --add-opens=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED + - --add-opens=java.base/sun.net.www.protocol.jrt=ALL-UNNAMED + - --add-opens=java.naming/javax.naming.spi=ALL-UNNAMED + - --add-opens=java.xml/com.sun.org.apache.xerces.internal.dom=ALL-UNNAMED + - --add-opens=java.base/java.lang=ALL-UNNAMED + - --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED + - --add-opens=java.base/java.net=ALL-UNNAMED + - -Dnashorn.args=--no-deprecation-warning" + - -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=[[.Env.AEM_PUBLISH_DEBUG_ADDR | default "0.0.0.0:14503" ]] +