You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2022/02/05 12:55:22 UTC

[sling-org-apache-sling-starter] 01/02: SLING-9638 - Update Starter Docker image to be based on the feature model

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter.git

commit 538b4147dfce162c7b8b26125ad05487ef319fa4
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Feb 4 17:47:08 2022 +0100

    SLING-9638 - Update Starter Docker image to be based on the feature model
    
    Attempt to minimise permission changes.
---
 Dockerfile | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 2c2b22c..bc1b014 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,21 +21,22 @@ LABEL org.opencontainers.image.authors="dev@sling.apache.org"
 
 EXPOSE 8080
 
-RUN mkdir -p /opt/sling/artifacts
+RUN groupadd --system sling && \
+    useradd --no-log-init --system --gid sling sling && \
+    mkdir /opt/sling && \
+    mkdir /opt/sling/launcher && \
+    mkdir /opt/sling/artifacts && \
+    chown -R sling:sling /opt/sling/launcher
+
+VOLUME /opt/sling/launcher
+
 COPY src/main/container /opt/sling
 COPY target/dependency/org.apache.sling.feature.launcher.jar /opt/sling
 COPY target/artifacts/ /opt/sling/artifacts/
 
-RUN groupadd -r sling && \
-    useradd --no-log-init -r -g sling sling && \
-    mkdir /opt/sling/launcher && \
-    chown sling:sling /opt/sling/launcher
-
 # ensure all files are readable by the sling user
-# for some reason some jar files are 0600 and others are 0644
-RUN find /opt/sling/artifacts -type f | xargs chmod 0644
-
-VOLUME /opt/sling/launcher
+# for some reason some jar files are 0600 while most are 0644
+RUN find /opt/sling/artifacts -type f -perm 0600 | xargs --no-run-if-empty chmod 0644
 
 USER sling:sling