File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ FROM stackable/image/java-base
4
4
5
5
ARG PRODUCT
6
6
ARG RELEASE
7
+ ARG STACKABLE_USER_UID
7
8
8
9
LABEL name="Hello World" \
9
10
maintainer="info@stackable.tech" \
@@ -13,13 +14,20 @@ LABEL name="Hello World" \
13
14
summary="The Stackable image for the Stackable Hello World Operator" \
14
15
description="This image is deployed by the Stackable Hello World Operator."
15
16
16
- RUN microdnf update && \
17
- microdnf clean all && \
18
- rm -rf /var/cache/yum
17
+ RUN <<EOF
18
+ microdnf update
19
+ microdnf clean all
20
+ rm -rf /var/cache/yum
19
21
20
- USER stackable
21
- WORKDIR /stackable
22
+ curl --fail -L https://repo.stackable.tech/repository/packages/hello-world/hello-world-${PRODUCT}.jar -o /stackable/hello-world.jar
23
+
24
+ # All files and folders owned by root to support running as arbitrary users
25
+ # This is best practice as all container users will belong to the root group (0)
26
+ chown -R ${STACKABLE_USER_UID}:0 /stackable
27
+ chmod -R g=u /stackable
28
+ EOF
22
29
23
- RUN curl --fail -L https://repo.stackable.tech/repository/packages/hello-world/hello-world-${PRODUCT}.jar -o hello-world.jar
30
+ USER ${STACKABLE_USER_UID}
31
+ WORKDIR /stackable
24
32
25
33
CMD ["java" , "-jar" , "hello-world.jar" ]
You can’t perform that action at this time.
0 commit comments