From 1963f8022bcb534904f85c62d12a259a3da984de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Gjesdal?= Date: Wed, 9 Oct 2024 21:43:07 +0200 Subject: [PATCH] create, add and run as user in last stage for dockerfile.cli --- Dockerfile.cli | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile.cli b/Dockerfile.cli index a935c6412874..aefa3877b8f9 100644 --- a/Dockerfile.cli +++ b/Dockerfile.cli @@ -48,7 +48,10 @@ RUN ant init_installation update_configs update_code FROM openjdk:${JDK_VERSION} # NOTE: DSPACE_INSTALL must align with the "dspace.dir" default configuration. ENV DSPACE_INSTALL=/dspace +RUN groupadd -g 1234 dspace && \ + useradd -u 1234 -g dspace dspace # Copy the /dspace directory from 'ant_build' container to /dspace in this container -COPY --from=ant_build /dspace $DSPACE_INSTALL +COPY --from=ant_build --chown 1234:1234 /dspace $DSPACE_INSTALL # Give java extra memory (1GB) ENV JAVA_OPTS=-Xmx1000m +USER dspace