From 642c4c9d8afcb2fb9a09ea8aa67d34705ed01f74 Mon Sep 17 00:00:00 2001 From: vpa1977 Date: Fri, 24 Feb 2023 22:28:21 +1300 Subject: [PATCH] Add docker files for standalone spring application --- benchmark/README.md | 2 ++ .../acmeair-standalone-chisel/Dockerfile | 11 ++++++++ .../acmeair-standalone-temurin/Dockerfile | 7 +++++ benchmark/build.sh | 4 +++ .../docker-compose.standalone-chisel.yml | 27 +++++++++++++++++++ .../docker-compose.standalone-temurin.yml | 27 +++++++++++++++++++ 6 files changed, 78 insertions(+) create mode 100644 benchmark/acmeair-standalone-chisel/Dockerfile create mode 100644 benchmark/acmeair-standalone-temurin/Dockerfile create mode 100644 benchmark/docker-compose.standalone-chisel.yml create mode 100644 benchmark/docker-compose.standalone-temurin.yml diff --git a/benchmark/README.md b/benchmark/README.md index 1cbb4cb..44d88a4 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -14,6 +14,7 @@ Run `./build.sh` to clone and build acmeair project. Run `docker-compose -f docker-compose.liberty.yml up` to bring up WebSphere liberty. Run `docker-compose -f docker-compose.tomcat.yml up` to bring up Tomcat. +Run `docker-compose -f docker-compose.standalone-temurin.yml up` to bring up standalone Spring Boot app. Wait for the application startup and navigate to http://localhost:9080/ to explore the application. @@ -21,6 +22,7 @@ Wait for the application startup and navigate to http://localhost:9080/ to explo Run `docker-compose -f docker-compose.cliberty.yml up` to bring up chiselled WebSphere liberty. Run `docker-compose -f docker-compose.ctomcat.yml up` to bring up Tomcat. +Run `docker-compose -f docker-compose.standalone-chisel.yml up` to bring up standalone Spring Boot app. Wait for the application startup and navigate to http://localhost:9080/ to explore the application. diff --git a/benchmark/acmeair-standalone-chisel/Dockerfile b/benchmark/acmeair-standalone-chisel/Dockerfile new file mode 100644 index 0000000..3785c85 --- /dev/null +++ b/benchmark/acmeair-standalone-chisel/Dockerfile @@ -0,0 +1,11 @@ +# Uncomment to enable CDS +#FROM eclipse-temurin:8u352-b08-jre-jammy as builder +FROM ubuntu/chiselled-jre:8_edge +#COPY --from=builder /opt/java/openjdk/lib/classlist /usr/lib/jvm/java-8-openjdk-amd64/jre/lib +#COPY --from=builder /bin/sh /bin/sh +#USER root +#RUN /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xshare:dump +#USER app +ADD acmeair-java-2.0.0-SNAPSHOT.jar / +#CMD [ "-Xshare:on", "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ] +CMD [ "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ] diff --git a/benchmark/acmeair-standalone-temurin/Dockerfile b/benchmark/acmeair-standalone-temurin/Dockerfile new file mode 100644 index 0000000..8b164b3 --- /dev/null +++ b/benchmark/acmeair-standalone-temurin/Dockerfile @@ -0,0 +1,7 @@ +FROM eclipse-temurin:8u352-b08-jre-jammy + +ADD acmeair-java-2.0.0-SNAPSHOT.jar / +# uncomment to enabled CDS +#RUN java -Xshare:dump +#CMD [ "java", "-Xshare:on", "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ] +CMD [ "java", "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ] diff --git a/benchmark/build.sh b/benchmark/build.sh index f736784..0756e67 100755 --- a/benchmark/build.sh +++ b/benchmark/build.sh @@ -13,6 +13,8 @@ mvn clean package -Pexternal-tomcat cp target/acmeair-java-2.0.0-SNAPSHOT.war ../acmeair-tomcat/ mvn -DskipTests=true package -Pexternal-liberty cp target/acmeair-java-2.0.0-SNAPSHOT.jar ../acmeair-liberty/ +cp target/acmeair-java-2.0.0-SNAPSHOT.jar ../acmeair-standalone-chisel/ +cp target/acmeair-java-2.0.0-SNAPSHOT.jar ../acmeair-standalone-temurin/ popd @@ -20,3 +22,5 @@ docker build -t acmeair-liberty acmeair-liberty docker build -t acmeair-cliberty acmeair-cliberty docker build -t acmeair-tomcat acmeair-tomcat docker build -t acmeair-ctomcat acmeair-ctomcat +docker build -t acmeair-standalone-chisel acmeair-standalone-chisel +docker build -t acmeair-standalone-temurin acmeair-standalone-temurin diff --git a/benchmark/docker-compose.standalone-chisel.yml b/benchmark/docker-compose.standalone-chisel.yml new file mode 100644 index 0000000..d0da354 --- /dev/null +++ b/benchmark/docker-compose.standalone-chisel.yml @@ -0,0 +1,27 @@ +version: '3' +services: + acmeair-db: + container_name: acmeair-db + image: mongo + ports: + - "27017:27017" + networks: + - acme + + tomcat: + container_name: acmeair-standalone-temurin + image: acmeair-standalone-temurin + networks: + - acme + ports: + - "9080:8080" + - "9443:8443" + - "7777:7777" + environment: + - MONGO_HOST=acmeair-db + tmpfs: + - /tmp + +networks: + acme: + driver: bridge diff --git a/benchmark/docker-compose.standalone-temurin.yml b/benchmark/docker-compose.standalone-temurin.yml new file mode 100644 index 0000000..d0da354 --- /dev/null +++ b/benchmark/docker-compose.standalone-temurin.yml @@ -0,0 +1,27 @@ +version: '3' +services: + acmeair-db: + container_name: acmeair-db + image: mongo + ports: + - "27017:27017" + networks: + - acme + + tomcat: + container_name: acmeair-standalone-temurin + image: acmeair-standalone-temurin + networks: + - acme + ports: + - "9080:8080" + - "9443:8443" + - "7777:7777" + environment: + - MONGO_HOST=acmeair-db + tmpfs: + - /tmp + +networks: + acme: + driver: bridge