File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ FROM stackable/image/java-base
5
5
6
6
ARG PRODUCT
7
7
ARG RELEASE
8
+ ARG STACKABLE_USER_UID
8
9
9
10
LABEL name="Trino CLI" \
10
11
maintainer="info@stackable.tech" \
@@ -22,14 +23,20 @@ RUN microdnf update && \
22
23
microdnf clean all && \
23
24
rm -rf /var/cache/yum
24
25
25
- USER stackable
26
- WORKDIR /stackable
27
26
28
- COPY --chown=stackable:stackable trino-cli/licenses /licenses
27
+ COPY --chown=${STACKABLE_USER_UID}:0 trino-cli/licenses /licenses
29
28
30
29
WORKDIR /stackable/trino-cli
31
30
32
- RUN curl -O https://repo.stackable.tech/repository/packages/trino-cli/trino-cli-${PRODUCT}-executable.jar \
33
- && ln -s trino-cli-${PRODUCT}-executable.jar trino-cli-executable.jar
31
+ RUN <<EOF
32
+ curl -O https://repo.stackable.tech/repository/packages/trino-cli/trino-cli-${PRODUCT}-executable.jar
33
+ ln -s trino-cli-${PRODUCT}-executable.jar trino-cli-executable.jar
34
34
35
+ # All files and folders owned by root group to support running as arbitrary users.
36
+ # This is best practice as all container users will belong to the root group (0).
37
+ chown -R ${STACKABLE_USER_UID}:0 /stackable
38
+ chmod -R g=u /stackable
39
+ EOF
40
+
41
+ USER ${STACKABLE_USER_UID}
35
42
ENTRYPOINT ["java" , "-jar" , "/stackable/trino-cli/trino-cli-executable.jar" ]
You can’t perform that action at this time.
0 commit comments