Skip to content

Commit f1c1071

Browse files
committed
Add Trino CLI
1 parent 3f90ae6 commit f1c1071

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

trino-cli/Dockerfile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ FROM stackable/image/java-base
55

66
ARG PRODUCT
77
ARG RELEASE
8+
ARG STACKABLE_USER_UID
89

910
LABEL name="Trino CLI" \
1011
maintainer="info@stackable.tech" \
@@ -22,14 +23,20 @@ RUN microdnf update && \
2223
microdnf clean all && \
2324
rm -rf /var/cache/yum
2425

25-
USER stackable
26-
WORKDIR /stackable
2726

28-
COPY --chown=stackable:stackable trino-cli/licenses /licenses
27+
COPY --chown=${STACKABLE_USER_UID}:0 trino-cli/licenses /licenses
2928

3029
WORKDIR /stackable/trino-cli
3130

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
3434

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}
3542
ENTRYPOINT ["java", "-jar", "/stackable/trino-cli/trino-cli-executable.jar"]

0 commit comments

Comments
 (0)