Skip to content

Commit

Permalink
Update Dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tsegismont committed Dec 2, 2024
1 parent 71fbb2d commit 08599b1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 17 deletions.
14 changes: 5 additions & 9 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ First, generate the project from https://start.vertx.io:
. Select the `JDK 11` JDK version
. Click on generate and extract the content somewhere on your disk

image::using-maven.png[title="Generating a Maven Project", alt="Generating a Maven Project", align="center",width=80%]

Alternatively, open a terminal and run:

[source,bash]
Expand Down Expand Up @@ -66,8 +64,8 @@ endif::env-github[]

The Docker build has two stages:

. Building the Maven project inside a `maven:3.6.3-openjdk-11` container
. Copying the output of the build in a `adoptopenjdk:11-jre-hotspot` container and configuring the entry point
. Building the Maven project inside a `maven:3.9.9-eclipse-temurin-11` container
. Copying the output of the build in a `eclipse-temurin:11` container and configuring the entry point

The benefits of this approach are:

Expand All @@ -92,8 +90,6 @@ First, generate the project from https://start.vertx.io:
. Select the `JDK 11` JDK version
. Click on generate and extract the content somewhere on your disk

image::using-gradle.png[title="Generating a Gradle Project", alt="Generating a Gradle Project", align="center",width=80%]

Alternatively, open a terminal and run:

[source,bash]
Expand Down Expand Up @@ -127,8 +123,8 @@ endif::env-github[]

The Docker build has two stages:

. Building the Gradle project inside a `gradle:6.8.3-jdk11` container
. Copying the output of the build in a `adoptopenjdk:11-jre-hotspot` container and configuring the entry point
. Building the Gradle project inside a `gradle:8.1.1-jdk11` container
. Copying the output of the build in a `eclipse-temurin:11` container and configuring the entry point

The benefits of this approach are:

Expand Down Expand Up @@ -157,7 +153,7 @@ You should see messages like these on the console output:

----
HTTP server started on port 8888
Mar 16, 2021 2:45:57 PM io.vertx.core.impl.launcher.commands.VertxIsolatedDeployer
Dec 02, 2024 5:17:19 PM io.vertx.launcher.application.VertxApplication
INFO: Succeeded in deploying verticle
----

Expand Down
8 changes: 4 additions & 4 deletions docker-gradle/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 1st Docker build stage: build the project with Gradle
FROM gradle:6.8.3-jdk11 as builder
FROM gradle:8.11.1-jdk11 AS builder
WORKDIR /project
COPY . /project/
RUN gradle assemble --no-daemon

# 2nd Docker build stage: copy builder output and configure entry point
FROM adoptopenjdk:11-jre-hotspot
ENV APP_DIR /application
ENV APP_FILE container-uber-jar.jar
FROM eclipse-temurin:11
ENV APP_DIR=/application
ENV APP_FILE=container-uber-jar.jar

EXPOSE 8888

Expand Down
8 changes: 4 additions & 4 deletions docker-maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# 1st Docker build stage: build the project with Maven
FROM maven:3.6.3-openjdk-11 as builder
FROM maven:3.9.9-eclipse-temurin-11 AS builder
WORKDIR /project
COPY . /project/
RUN mvn package -DskipTests -B

# 2nd Docker build stage: copy builder output and configure entry point
FROM adoptopenjdk:11-jre-hotspot
ENV APP_DIR /application
ENV APP_FILE container-uber-jar.jar
FROM eclipse-temurin:11
ENV APP_DIR=/application
ENV APP_FILE=container-uber-jar.jar

EXPOSE 8888

Expand Down
Binary file removed using-gradle.png
Binary file not shown.
Binary file removed using-maven.png
Binary file not shown.

0 comments on commit 08599b1

Please # to comment.