You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2021/04/29 05:23:17 UTC

[james-project] 08/10: JAMES-3261 Docker images should reuse the ZIPs

This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 599303f6cd0a9f947edd725fbb89405ce4b3cb78
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sat Apr 17 17:03:26 2021 +0700

    JAMES-3261 Docker images should reuse the ZIPs
---
 dockerfiles/compilation/java-11/compile.sh         | 27 +++++-----------------
 .../run/guice/cassandra-rabbitmq/Dockerfile        |  9 +++++---
 .../cassandra-rabbitmq/destination/run_james.sh    |  6 ++++-
 dockerfiles/run/guice/cassandra/Dockerfile         |  9 +++++---
 .../run/guice/cassandra/destination/run_james.sh   |  6 ++++-
 dockerfiles/run/guice/jpa-smtp/Dockerfile          |  9 +++++---
 .../run/guice/jpa-smtp/destination/run_james.sh    |  8 ++++++-
 dockerfiles/run/guice/jpa/Dockerfile               |  9 +++++---
 dockerfiles/run/guice/jpa/destination/run_james.sh |  7 +++++-
 dockerfiles/run/guice/memory/Dockerfile            |  5 +++-
 10 files changed, 57 insertions(+), 38 deletions(-)

diff --git a/dockerfiles/compilation/java-11/compile.sh b/dockerfiles/compilation/java-11/compile.sh
index dfb6ddf..34d82ef 100755
--- a/dockerfiles/compilation/java-11/compile.sh
+++ b/dockerfiles/compilation/java-11/compile.sh
@@ -21,9 +21,8 @@ GLOW_ROOT_LIB=${GLOW_ROOT_DIR}/lib
 ORIGIN=/origin
 CASSANDRA_DESTINATION=/cassandra/destination
 CASSANDRA_RABBITMQ_DESTINATION=/cassandra-rabbitmq/destination
-CASSANDRA_RABBITMQ_LDAP_DESTINATION=/cassandra-rabbitmq-ldap/destination
 JPA_DESTINATION=/jpa/destination
-JPA_SMTP_DESTINATION=/jpa-smpt/destination
+JPA_SMTP_DESTINATION=/jpa-smtp/destination
 MEMORY_DESTINATION=/memory/destination
 SPRING_DESTINATION=/spring/destination
 SWAGGER_DESTINATION=/swagger
@@ -71,43 +70,30 @@ unzip $GLOW_ROOT_ZIP
 # Retrieve result
 
 if [ $? -eq 0 ]; then
-   if [ -d "$CASSANDRA_RABBITMQ_LDAP_DESTINATION" ]; then
-      echo "Copying cassandra - rabbitMQ - Ldap JARs"
-      cp server/container/guice/cassandra-rabbitmq-guice/target/james-server-cassandra-rabbitmq-guice.jar $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
-      cp -r server/container/guice/cassandra-rabbitmq-guice/target/james-server-cassandra-rabbitmq-guice.lib $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
-      cp server/container/cli/target/james-server-cli.jar $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
-      cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_RABBITMQ_LDAP_DESTINATION || true
-      mkdir -p ${CASSANDRA_RABBITMQ_LDAP_DESTINATION}/glowroot
-      cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_RABBITMQ_LDAP_DESTINATION}/glowroot || true
-   fi
 
    if [ -d "$CASSANDRA_RABBITMQ_DESTINATION" ]; then
       echo "Copying cassandra RabbitMQ JARs"
-      cp server/container/guice/cassandra-rabbitmq-guice/target/james-server-cassandra-rabbitmq-guice.jar $CASSANDRA_RABBITMQ_DESTINATION || true
-      cp -r server/container/guice/cassandra-rabbitmq-guice/target/james-server-cassandra-rabbitmq-guice.lib $CASSANDRA_RABBITMQ_DESTINATION || true
+      cp server/container/guice/cassandra-rabbitmq-guice/target/james-server-distributed-guice.zip $CASSANDRA_RABBITMQ_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $CASSANDRA_RABBITMQ_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_RABBITMQ_DESTINATION || true
+
       mkdir -p ${CASSANDRA_RABBITMQ_DESTINATION}/glowroot
       cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_RABBITMQ_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$CASSANDRA_DESTINATION" ]; then
       echo "Copying cassandra JARs"
-      cp server/container/guice/cassandra-guice/target/james-server-cassandra-guice.jar $CASSANDRA_DESTINATION || true
-      cp -r server/container/guice/cassandra-guice/target/james-server-cassandra-guice.lib $CASSANDRA_DESTINATION || true
+      cp server/container/guice/cassandra-guice/target/james-server-cassandra-guice.zip $CASSANDRA_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $CASSANDRA_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $CASSANDRA_DESTINATION || true
 
-      cp server/container/guice/cassandra-guice/target/james-server-cassandra-guice.jar $CASSANDRA_DESTINATION || true
-      cp -r server/container/guice/cassandra-guice/target/james-server-cassandra-guice.lib $CASSANDRA_DESTINATION || true
       mkdir -p ${CASSANDRA_DESTINATION}/glowroot
       cp -r ${GLOW_ROOT_DIR}/* ${CASSANDRA_DESTINATION}/glowroot || true
    fi
 
    if [ -d "$JPA_DESTINATION" ]; then
       echo "Copying JPA jars"
-      cp server/container/guice/jpa-guice/target/james-server-jpa-guice.jar $JPA_DESTINATION || true
-      cp -r server/container/guice/jpa-guice/target/james-server-jpa-guice.lib $JPA_DESTINATION || true
+      cp server/container/guice/jpa-guice/target/james-server-jpa-guice.zip $JPA_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $JPA_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $JPA_DESTINATION || true
       mkdir -p ${JPA_DESTINATION}/glowroot
@@ -116,8 +102,7 @@ if [ $? -eq 0 ]; then
 
    if [ -d "$JPA_SMTP_DESTINATION" ]; then
       echo "Copying JPA-SMTP jars"
-      cp server/container/guice/jpa-smpt/target/james-server-jpa-smtp-guice.jar $JPA_SMTP_DESTINATION || true
-      cp -r server/container/guice/jpa-smpt/target/james-server-jpa-smtp-guice.lib $JPA_SMTP_DESTINATION || true
+      cp server/container/guice/jpa-smtp/target/james-server-jpa-smtp-guice.zip $JPA_SMTP_DESTINATION || true
       cp server/container/cli/target/james-server-cli.jar $JPA_SMTP_DESTINATION || true
       cp -r server/container/cli/target/james-server-cli.lib $JPA_SMTP_DESTINATION || true
       mkdir -p ${JPA_SMTP_DESTINATION}/glowroot
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
index 9c1f5cf..90cfe3c 100644
--- a/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/Dockerfile
@@ -17,13 +17,16 @@ FROM adoptopenjdk:11-jre-hotspot
 EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
+RUN apt-get update && apt-get install -y unzip
 
 # Get data we need to run James : build results and configuration
-ADD destination/james-server-cassandra-rabbitmq-guice.jar /root/james-server.jar
-ADD destination/james-server-cassandra-rabbitmq-guice.lib /root/james-server-cassandra-rabbitmq-guice.lib
+ADD destination/james-server-distributed-guice.zip /root
+RUN unzip james-server-distributed-guice.zip && \
+   cp -r /root/james-server-distributed-guice/* /root && \
+   rm james-server-distributed-guice.zip && \
+   rm -r james-server-distributed-guice
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/conf /root/conf
 ADD destination/glowroot/plugins /root/glowroot/plugins
 ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
 ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
index 02f2bf6..3450399 100755
--- a/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
+++ b/dockerfiles/run/guice/cassandra-rabbitmq/destination/run_james.sh
@@ -2,4 +2,8 @@
 if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
     GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
 fi
-java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
+
+java -Dworking.directory=. \
+  $GLOWROOT_OPTIONS \
+  $JVM_OPTIONS \
+  -Dlogback.configurationFile=conf/logback.xml -jar james-server-cassandra-rabbitmq-guice.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/cassandra/Dockerfile b/dockerfiles/run/guice/cassandra/Dockerfile
index ed582ef..c478642 100644
--- a/dockerfiles/run/guice/cassandra/Dockerfile
+++ b/dockerfiles/run/guice/cassandra/Dockerfile
@@ -17,13 +17,16 @@ FROM adoptopenjdk:11-jre-hotspot
 EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
+RUN apt-get update && apt-get install -y unzip
 
 # Get data we need to run James : build results and configuration
-ADD destination/james-server-cassandra-guice.jar /root/james-server.jar
-ADD destination/james-server-cassandra-guice.lib /root/james-server-cassandra-guice.lib
+ADD destination/james-server-cassandra-guice.zip /root
+RUN unzip james-server-cassandra-guice.zip && \
+   cp -r /root/james-server-cassandra-guice/* /root && \
+   rm james-server-cassandra-guice.zip && \
+   rm -r james-server-cassandra-guice
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/conf /root/conf
 ADD destination/glowroot/plugins /root/glowroot/plugins
 ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
 ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
diff --git a/dockerfiles/run/guice/cassandra/destination/run_james.sh b/dockerfiles/run/guice/cassandra/destination/run_james.sh
index 02f2bf6..301fd99 100755
--- a/dockerfiles/run/guice/cassandra/destination/run_james.sh
+++ b/dockerfiles/run/guice/cassandra/destination/run_james.sh
@@ -2,4 +2,8 @@
 if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
     GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
 fi
-java -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS $GLOWROOT_OPTIONS -jar james-server.jar
\ No newline at end of file
+
+java -Dworking.directory=. \
+  $GLOWROOT_OPTIONS \
+  $JVM_OPTIONS \
+  -Dlogback.configurationFile=conf/logback.xml -jar james-server-cassandra-guice.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa-smtp/Dockerfile b/dockerfiles/run/guice/jpa-smtp/Dockerfile
index c758b5d..1f2ce41 100644
--- a/dockerfiles/run/guice/jpa-smtp/Dockerfile
+++ b/dockerfiles/run/guice/jpa-smtp/Dockerfile
@@ -15,13 +15,16 @@ FROM adoptopenjdk:11-jre-hotspot
 EXPOSE 25 143 465 587 4000 8000
 
 WORKDIR /root
+RUN apt-get update && apt-get install -y unzip
 
 # Get data we need to run James : build results and configuration
-ADD destination/james-server-jpa-smtp-guice.jar /root/james-server-jpa-smtp-guice.jar
-ADD destination/james-server-jpa-smtp-guice.lib /root/james-server-jpa-smtp-guice.lib
+ADD destination/james-server-jpa-smtp-guice.zip /root
+RUN unzip james-server-jpa-smtp-guice.zip && \
+   cp -r /root/james-server-jpa-smtp-guice/* /root && \
+   rm james-server-jpa-smtp-guice.zip && \
+   rm -r james-server-jpa-smtp-guice
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/conf /root/conf
 ADD destination/glowroot/plugins /root/glowroot/plugins
 ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
 ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
diff --git a/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
index 3a595e6..4e518fe 100755
--- a/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
+++ b/dockerfiles/run/guice/jpa-smtp/destination/run_james.sh
@@ -2,4 +2,10 @@
 if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
     GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
 fi
-java -classpath '/root/james-server-jpa-smtp-guice.jar:/root/james-server-jpa-smtp-guice.lib/*' -javaagent:/root/james-server-jpa-smtp-guice.lib/openjpa-3.1.2.jar $GLOWROOT_OPTIONS -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
\ No newline at end of file
+
+
+java -javaagent:james-server-jpa-smtp-guice.lib/openjpa-3.1.2.jar \
+  -Dworking.directory=. \
+  $GLOWROOT_OPTIONS \
+  $JVM_OPTIONS \
+  -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-smtp-guice.jar
\ No newline at end of file
diff --git a/dockerfiles/run/guice/jpa/Dockerfile b/dockerfiles/run/guice/jpa/Dockerfile
index 2a10c54..32fe284 100644
--- a/dockerfiles/run/guice/jpa/Dockerfile
+++ b/dockerfiles/run/guice/jpa/Dockerfile
@@ -17,13 +17,16 @@ FROM adoptopenjdk:11-jre-hotspot
 EXPOSE 25 110 143 465 587 993 4000 8000
 
 WORKDIR /root
+RUN apt-get update && apt-get install -y unzip
 
 # Get data we need to run James : build results and configuration
-ADD destination/james-server-jpa-guice.jar /root/james-server.jar
-ADD destination/james-server-jpa-guice.lib /root/james-server-jpa-guice.lib
+ADD destination/james-server-jpa-guice.zip /root
+RUN unzip james-server-jpa-guice.zip && \
+   cp -r /root/james-server-jpa-guice/* /root && \
+   rm james-server-jpa-guice.zip && \
+   rm -r james-server-jpa-guice
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
-ADD destination/conf /root/conf
 ADD destination/glowroot/plugins /root/glowroot/plugins
 ADD destination/glowroot/glowroot.jar /root/glowroot/glowroot.jar
 ADD destination/glowroot/lib/glowroot-embedded-collector.jar /root/glowroot/lib/glowroot-embedded-collector.jar
diff --git a/dockerfiles/run/guice/jpa/destination/run_james.sh b/dockerfiles/run/guice/jpa/destination/run_james.sh
index 5b3b26e..ec4cc1a 100755
--- a/dockerfiles/run/guice/jpa/destination/run_james.sh
+++ b/dockerfiles/run/guice/jpa/destination/run_james.sh
@@ -2,4 +2,9 @@
 if [ "$GLOWROOT_ACTIVATED" == "true" ]; then
     GLOWROOT_OPTIONS=-javaagent:/root/glowroot/glowroot.jar
 fi
-java -classpath '/root/james-server.jar:/root/james-server-jpa-guice.lib/*' -javaagent:/root/james-server-jpa-guice.lib/openjpa-3.1.2.jar $GLOWROOT_OPTIONS -Dlogback.configurationFile=/root/conf/logback.xml -Dworking.directory=/root/ $JVM_OPTIONS org.apache.james.JPAJamesServerMain
+
+java -Dworking.directory=. \
+  $GLOWROOT_OPTIONS \
+  $JVM_OPTIONS \
+  -Dlogback.configurationFile=conf/logback.xml -jar james-server-jpa-guice.jar
+
diff --git a/dockerfiles/run/guice/memory/Dockerfile b/dockerfiles/run/guice/memory/Dockerfile
index 1dc717c..fd99b90 100644
--- a/dockerfiles/run/guice/memory/Dockerfile
+++ b/dockerfiles/run/guice/memory/Dockerfile
@@ -22,7 +22,10 @@ RUN apt-get update && apt-get install -y unzip
 
 # Get data we need to run James : build results and configuration
 ADD destination/james-server-memory-guice.zip /root
-RUN unzip james-server-memory-guice.zip && cp -r /root/james-server-memory-guice/* /root
+RUN unzip james-server-memory-guice.zip && \
+  cp -r /root/james-server-memory-guice/* /root && \
+  rm james-server-memory-guice.zip && \
+  rm -r james-server-memory-guice
 ADD destination/james-server-cli.jar /root/james-cli.jar
 ADD destination/james-server-cli.lib /root/james-server-cli.lib
 ADD destination/conf /root/conf

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org