Skip to content

Commit

Permalink
feat(#2161): Generate layered Docker images (#2162)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikriemer authored Nov 10, 2023
1 parent 7f94954 commit f31563b
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 23 deletions.
17 changes: 10 additions & 7 deletions streampipes-extensions/streampipes-extensions-all-iiot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM eclipse-temurin:17-jre-focal

# needed pkgs processors-image-processing-jvm
RUN apt-get update && apt-get install ttf-dejavu-core && apt-get install fontconfig
FROM eclipse-temurin:17-jre-focal as builder
ARG JAR_FILE=target/streampipes-extensions-all-iiot.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

COPY target/streampipes-extensions-all-iiot.jar /streampipes-extensions-all-iiot.jar

ENTRYPOINT ["java", "-jar", "/streampipes-extensions-all-iiot.jar"]
FROM eclipse-temurin:17-jre-focal
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,11 @@
</configuration>
</execution>
</executions>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
</plugin>
</plugins>
<finalName>streampipes-extensions-all-iiot</finalName>
Expand Down
14 changes: 10 additions & 4 deletions streampipes-extensions/streampipes-extensions-all-jvm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM eclipse-temurin:17-jre-focal
FROM eclipse-temurin:17-jre-focal as builder
ARG JAR_FILE=target/streampipes-extensions-all-jvm.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

FROM eclipse-temurin:17-jre-focal
# needed pkgs processors-image-processing-jvm
RUN apt-get update && apt-get install ttf-dejavu-core && apt-get install fontconfig

COPY target/streampipes-extensions-all-jvm.jar /streampipes-extensions-all-jvm.jar

ENTRYPOINT ["java", "-jar", "/streampipes-extensions-all-jvm.jar"]
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
5 changes: 5 additions & 0 deletions streampipes-extensions/streampipes-extensions-all-jvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@
</configuration>
</execution>
</executions>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
</plugin>
</plugins>
<finalName>streampipes-extensions-all-jvm</finalName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM eclipse-temurin:17-jre-focal

COPY target/streampipes-extensions-iiot-minimal.jar /streampipes-extensions-iiot-minimal.jar
FROM eclipse-temurin:17-jre-focal as builder
ARG JAR_FILE=target/streampipes-extensions-iiot-minimal.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

ENTRYPOINT ["java", "-jar", "/streampipes-extensions-iiot-minimal.jar"]
FROM eclipse-temurin:17-jre-focal
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,11 @@
</configuration>
</execution>
</executions>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
</configuration>
</plugin>
</plugins>
<finalName>streampipes-extensions-iiot-minimal</finalName>
Expand Down
14 changes: 10 additions & 4 deletions streampipes-service-core-minimal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM eclipse-temurin:17-jre-focal

COPY target/streampipes-core-minimal.jar /streampipes-core.jar
FROM eclipse-temurin:17-jre-focal as builder
ARG JAR_FILE=target/streampipes-core-minimal.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

ENTRYPOINT ["java", "-jar", "/streampipes-core.jar"]
FROM eclipse-temurin:17-jre-focal
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
3 changes: 3 additions & 0 deletions streampipes-service-core-minimal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
</execution>
</executions>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
<environmentVariables>
<SP_COUCHDB_HOST>localhost</SP_COUCHDB_HOST>
<SP_BACKEND_HOST>localhost</SP_BACKEND_HOST>
Expand Down
14 changes: 10 additions & 4 deletions streampipes-service-core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM eclipse-temurin:17-jre-focal

COPY target/streampipes-core.jar /streampipes-core.jar
FROM eclipse-temurin:17-jre-focal as builder
ARG JAR_FILE=target/streampipes-core.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

ENTRYPOINT ["java", "-jar", "/streampipes-core.jar"]
FROM eclipse-temurin:17-jre-focal
COPY --from=builder dependencies/ ./
COPY --from=builder snapshot-dependencies/ ./
COPY --from=builder spring-boot-loader/ ./
COPY --from=builder application/ ./
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
3 changes: 3 additions & 0 deletions streampipes-service-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@
</execution>
</executions>
<configuration>
<layers>
<enabled>true</enabled>
</layers>
<environmentVariables>
<SP_COUCHDB_HOST>localhost</SP_COUCHDB_HOST>
<SP_BACKEND_HOST>localhost</SP_BACKEND_HOST>
Expand Down

0 comments on commit f31563b

Please sign in to comment.