From 1af4c1400f4db86a41c05cb38c7c58122b0b55a5 Mon Sep 17 00:00:00 2001 From: Sebastian Eicke Date: Fri, 22 Nov 2024 08:31:54 +0100 Subject: [PATCH 1/2] Add proxy build argument to dockerfiles --- .../basyx.aasdiscoveryservice.component/Dockerfile | 2 ++ .../basyx.aasenvironment.component/Dockerfile | 2 ++ .../src/main/docker/Dockerfile | 2 ++ .../src/main/docker/Dockerfile | 5 ++++- .../src/main/docker/Dockerfile | 4 ++++ .../src/main/docker/Dockerfile | 4 ++++ basyx.aasrepository/basyx.aasrepository.component/Dockerfile | 2 ++ .../basyx.aasxfileserver.component/Dockerfile | 2 ++ .../basyx.conceptdescriptionrepository.component/Dockerfile | 2 ++ .../src/main/docker/Dockerfile | 4 ++++ .../src/main/docker/Dockerfile | 4 ++++ .../src/main/docker/Dockerfile | 4 ++++ .../src/main/docker/Dockerfile | 4 ++++ .../basyx.submodelrepository.component/Dockerfile | 2 ++ .../basyx.submodelservice.example/Dockerfile | 2 ++ ci/keycloak/Dockerfile | 3 ++- ci/keycloak/Dockerfile.keycloak | 4 ++++ examples/BaSyxClient/basyx-client/Dockerfile | 4 ++++ examples/BaSyxClient/legacy-erp/Dockerfile | 3 ++- examples/BaSyxDatabridge/mqtt-publisher/Dockerfile | 3 ++- .../exampleOperationService/Dockerfile | 4 ++++ examples/BaSyxSecured/keycloak/Dockerfile | 2 ++ 22 files changed, 64 insertions(+), 4 deletions(-) diff --git a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile index ce67dd54f..99b045565 100644 --- a/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile +++ b/basyx.aasdiscoveryservice/basyx.aasdiscoveryservice.component/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile b/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile index ce67dd54f..99b045565 100644 --- a/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile +++ b/basyx.aasenvironment/basyx.aasenvironment.component/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile index bbddc1da9..809ea1de9 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mem/src/main/docker/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile index 7e157b1ca..0b3c4ef17 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile @@ -1,8 +1,11 @@ FROM eclipse-temurin:17 as builder -COPY maven/${project.build.finalName}.jar ./ +ARG HTTP_PROXY +ARG HTTPS_PROXYCOPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile index d2f36e7ad..b1dd2c254 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-log-mem/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile index 3acf47076..9d12e5f47 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-log-mongodb/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.aasrepository/basyx.aasrepository.component/Dockerfile b/basyx.aasrepository/basyx.aasrepository.component/Dockerfile index ce67dd54f..99b045565 100644 --- a/basyx.aasrepository/basyx.aasrepository.component/Dockerfile +++ b/basyx.aasrepository/basyx.aasrepository.component/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile b/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile index ce67dd54f..99b045565 100644 --- a/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile +++ b/basyx.aasxfileserver/basyx.aasxfileserver.component/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile index f79271fc5..a628311c2 100644 --- a/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile +++ b/basyx.conceptdescriptionrepository/basyx.conceptdescriptionrepository.component/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile index bbddc1da9..7be41ac9c 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mem/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile index 7e157b1ca..958fc90df 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile index d2f36e7ad..b1dd2c254 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mem/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile index 3acf47076..9d12e5f47 100644 --- a/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile +++ b/basyx.submodelregistry/basyx.submodelregistry-service-release-log-mongodb/src/main/docker/Dockerfile @@ -1,8 +1,12 @@ FROM eclipse-temurin:17 as builder +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN mkdir /workspace WORKDIR /workspace COPY --from=builder dependencies/ ./ diff --git a/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile b/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile index ce67dd54f..99b045565 100644 --- a/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile +++ b/basyx.submodelrepository/basyx.submodelrepository.component/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/basyx.submodelservice/basyx.submodelservice.example/Dockerfile b/basyx.submodelservice/basyx.submodelservice.example/Dockerfile index ce67dd54f..99b045565 100644 --- a/basyx.submodelservice/basyx.submodelservice.example/Dockerfile +++ b/basyx.submodelservice/basyx.submodelservice.example/Dockerfile @@ -1,4 +1,6 @@ FROM eclipse-temurin:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY USER nobody WORKDIR /application ARG JAR_FILE=target/*-exec.jar diff --git a/ci/keycloak/Dockerfile b/ci/keycloak/Dockerfile index 54bc49c28..8f4ff346f 100644 --- a/ci/keycloak/Dockerfile +++ b/ci/keycloak/Dockerfile @@ -1,5 +1,6 @@ FROM quay.io/keycloak/keycloak:22.0.0 - +ARG HTTP_PROXY +ARG HTTPS_PROXY # Make the realm configuration available for import COPY /realm/BaSyx-realm.json /opt/keycloak_import/ diff --git a/ci/keycloak/Dockerfile.keycloak b/ci/keycloak/Dockerfile.keycloak index f7f0af270..e9eaa153f 100644 --- a/ci/keycloak/Dockerfile.keycloak +++ b/ci/keycloak/Dockerfile.keycloak @@ -1,5 +1,7 @@ # syntax=docker/dockerfile:1 FROM maven:3-eclipse-temurin-17-alpine as build +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /workspace COPY ./initializer/pom.xml /workspace/pom.xml COPY ./initializer/src /workspace/src @@ -7,6 +9,8 @@ COPY ./realm/BaSyx-realm.json /workspace/BaSyx-realm.json RUN mvn install FROM keycloak/keycloak:24.0.4 +ARG HTTP_PROXY +ARG HTTPS_PROXY COPY --from=build /workspace/target/org.eclipse.digitaltwin.basyx.v3.clients-keycloak-issuer-initializer.jar /opt/keycloak/providers/issuer-initializer.jar COPY --from=build /workspace/BaSyx-realm.json /opt/keycloak/data/import/BaSyx-realm.json diff --git a/examples/BaSyxClient/basyx-client/Dockerfile b/examples/BaSyxClient/basyx-client/Dockerfile index d1c6edeb9..4dff8d0a3 100644 --- a/examples/BaSyxClient/basyx-client/Dockerfile +++ b/examples/BaSyxClient/basyx-client/Dockerfile @@ -1,10 +1,14 @@ FROM maven:3.8.1-openjdk-17 AS build +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /app COPY pom.xml . COPY src src RUN mvn clean package -DskipTests FROM openjdk:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /app COPY --from=build /app/target/*-jar-with-dependencies.jar app.jar ENTRYPOINT ["java", "-jar", "app.jar"] diff --git a/examples/BaSyxClient/legacy-erp/Dockerfile b/examples/BaSyxClient/legacy-erp/Dockerfile index c19403a83..6e1e5529a 100644 --- a/examples/BaSyxClient/legacy-erp/Dockerfile +++ b/examples/BaSyxClient/legacy-erp/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.10-slim - +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /app COPY . /app diff --git a/examples/BaSyxDatabridge/mqtt-publisher/Dockerfile b/examples/BaSyxDatabridge/mqtt-publisher/Dockerfile index 9883c13ca..1217cd26f 100644 --- a/examples/BaSyxDatabridge/mqtt-publisher/Dockerfile +++ b/examples/BaSyxDatabridge/mqtt-publisher/Dockerfile @@ -1,5 +1,6 @@ FROM python:3.8-slim - +ARG HTTP_PROXY +ARG HTTPS_PROXY RUN pip install paho-mqtt COPY publisher.py /publisher.py diff --git a/examples/BaSyxOperationDelegation/exampleOperationService/Dockerfile b/examples/BaSyxOperationDelegation/exampleOperationService/Dockerfile index 0fdf815fa..72131f74b 100644 --- a/examples/BaSyxOperationDelegation/exampleOperationService/Dockerfile +++ b/examples/BaSyxOperationDelegation/exampleOperationService/Dockerfile @@ -1,5 +1,7 @@ # Stage 1: Build Stage FROM maven:3.8.1-openjdk-17 AS build +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /app # Kopiere die pom.xml und lade die Abhängigkeiten herunter COPY pom.xml . @@ -11,6 +13,8 @@ RUN mvn clean package -DskipTests # Stage 2: Runtime Stage FROM openjdk:17 +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /app COPY --from=build /app/target/*.jar app.jar EXPOSE 8080 diff --git a/examples/BaSyxSecured/keycloak/Dockerfile b/examples/BaSyxSecured/keycloak/Dockerfile index e9a06667c..1af526960 100644 --- a/examples/BaSyxSecured/keycloak/Dockerfile +++ b/examples/BaSyxSecured/keycloak/Dockerfile @@ -1,5 +1,7 @@ # syntax=docker/dockerfile:1 FROM maven:3-eclipse-temurin-17 AS build +ARG HTTP_PROXY +ARG HTTPS_PROXY WORKDIR /workspace COPY ./initializer/pom.xml /workspace/pom.xml COPY ./initializer/src /workspace/src From 8b8c2bcb89b57d837feefeafa23274aaeb6f1e72 Mon Sep 17 00:00:00 2001 From: Sebastian Eicke Date: Fri, 22 Nov 2024 08:51:18 +0100 Subject: [PATCH 2/2] Fix missing newline --- .../src/main/docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile index 0b3c4ef17..958fc90df 100644 --- a/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile +++ b/basyx.aasregistry/basyx.aasregistry-service-release-kafka-mongodb/src/main/docker/Dockerfile @@ -1,6 +1,7 @@ FROM eclipse-temurin:17 as builder ARG HTTP_PROXY -ARG HTTPS_PROXYCOPY maven/${project.build.finalName}.jar ./ +ARG HTTPS_PROXY +COPY maven/${project.build.finalName}.jar ./ RUN java -Djarmode=layertools -jar ${project.build.finalName}.jar extract FROM eclipse-temurin:17