You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2023/02/02 22:03:49 UTC
[streampipes] branch SP-454 created (now 1b24972c3)
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a change to branch SP-454
in repository https://gitbox.apache.org/repos/asf/streampipes.git
at 1b24972c3 [#454] Add non-root user to backend and extension dockerfile
This branch includes the following new commits:
new 1b24972c3 [#454] Add non-root user to backend and extension dockerfile
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[streampipes] 01/01: [#454] Add non-root user to backend and extension dockerfile
Posted by ze...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
zehnder pushed a commit to branch SP-454
in repository https://gitbox.apache.org/repos/asf/streampipes.git
commit 1b24972c30a313984552f2d2605fb3121f7ab68c
Author: Philipp Zehnder <te...@users.noreply.github.com>
AuthorDate: Thu Feb 2 23:03:31 2023 +0100
[#454] Add non-root user to backend and extension dockerfile
---
streampipes-extensions/streampipes-extensions-all-jvm/Dockerfile | 9 +++++++++
streampipes-service-core/Dockerfile | 9 +++++++++
2 files changed, 18 insertions(+)
diff --git a/streampipes-extensions/streampipes-extensions-all-jvm/Dockerfile b/streampipes-extensions/streampipes-extensions-all-jvm/Dockerfile
index d84e5bcea..3c9287b67 100644
--- a/streampipes-extensions/streampipes-extensions-all-jvm/Dockerfile
+++ b/streampipes-extensions/streampipes-extensions-all-jvm/Dockerfile
@@ -15,9 +15,18 @@
FROM eclipse-temurin:17-jre-focal
+ARG USERNAME=javauser
+ARG USER_UID=1000
+ARG USER_GID=$USER_UID
+
# 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
+RUN groupadd --gid $USER_GID $USERNAME \
+ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
+
+USER $USERNAME
+
ENTRYPOINT ["java", "-jar", "/streampipes-extensions-all-jvm.jar"]
diff --git a/streampipes-service-core/Dockerfile b/streampipes-service-core/Dockerfile
index 48e2dad56..f6358a884 100644
--- a/streampipes-service-core/Dockerfile
+++ b/streampipes-service-core/Dockerfile
@@ -15,6 +15,15 @@
FROM eclipse-temurin:17-jre-focal
+ARG USERNAME=javauser
+ARG USER_UID=1000
+ARG USER_GID=$USER_UID
+
COPY target/streampipes-backend.jar /streampipes-backend.jar
+RUN groupadd --gid $USER_GID $USERNAME \
+ && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME
+
+USER $USERNAME
+
ENTRYPOINT ["java", "-jar", "/streampipes-backend.jar"]