@@ -10,6 +10,9 @@ FROM python:3.12-slim-bullseye@sha256:229b2897e6b5c630d83a721e42dd1c96e3ec996323
1010ARG PRODUCT
1111ARG RELEASE
1212ARG KEYCLOAK_VERSION
13+ ARG STACKABLE_USER_UID
14+ ARG STACKABLE_USER_GID
15+ ARG STACKABLE_USER_NAME
1316
1417LABEL name="Stackable Testing Tools" \
1518@@ -25,49 +28,54 @@ SHELL ["/bin/bash", "-euo", "pipefail", "-c"]
2528# This is needed so that krb5-user installs without prompting for a realm.
2629ENV DEBIAN_FRONTEND=noninteractive
2730
28- # krb5-user/libkrb5-dev are needed for Kerberos support.
29- RUN apt-get update && \
30- apt-get install -y --no-install-recommends \
31- build-essential \
32- ca-certificates \
33- curl \
34- gzip \
35- jq \
36- krb5-user \
37- kubernetes-client \
38- libkrb5-dev \
39- libssl-dev \
40- libxml2-dev \
41- libxslt1-dev \
42- pkg-config \
43- python3-certifi \
44- python3-idna \
45- python3-semver \
46- python3-thrift \
47- python3-toml \
48- python3-urllib3 \
49- tar \
50- zip \
51- unzip \
52- # Java 11 seems like the best middle-ground for all tools
53- openjdk-11-jdk-headless && \
54- apt-get clean && \
55- rm -rf /var/lib/apt/lists/*
5631
5732COPY testing-tools/python /stackable/python
5833COPY testing-tools/licenses /licenses
5934
60- ENV PATH=/stackable/keycloak/bin:$PATH
61- RUN curl --fail -L https://repo.stackable.tech/repository/packages/keycloak/keycloak-${KEYCLOAK_VERSION}.tar.gz | tar -xzC /stackable && \
62- ln -s /stackable/keycloak-${KEYCLOAK_VERSION} /stackable/keycloak
35+ # krb5-user/libkrb5-dev are needed for Kerberos support.
36+ # Java 11 seems like the best middle-ground for all tools
37+ RUN <<EOF
38+ apt-get update
39+ apt-get install -y --no-install-recommends \
40+ build-essential \
41+ ca-certificates \
42+ curl \
43+ gzip \
44+ jq \
45+ krb5-user \
46+ kubernetes-client \
47+ libkrb5-dev \
48+ libssl-dev \
49+ libxml2-dev \
50+ libxslt1-dev \
51+ pkg-config \
52+ python3-certifi \
53+ python3-idna \
54+ python3-semver \
55+ python3-thrift \
56+ python3-toml \
57+ python3-urllib3 \
58+ tar \
59+ zip \
60+ unzip \
61+ openjdk-11-jdk-headless
62+
63+ apt-get clean
64+ rm -rf /var/lib/apt/lists/*
6365
64- RUN pip install --no-cache-dir --upgrade pip && \
65- pip install --no-cache-dir -r /stackable/python/requirements.txt && \
66- groupadd -r stackable --gid=1000 && \
67- useradd -r -g stackable --uid=1000 stackable && \
68- chown -R stackable:stackable /stackable
66+ curl --fail -L https://repo.stackable.tech/repository/packages/keycloak/keycloak-${KEYCLOAK_VERSION}.tar.gz | tar -xzC /stackable
67+ ln -s /stackable/keycloak-${KEYCLOAK_VERSION} /stackable/keycloak
68+
69+ pip install --no-cache-dir --upgrade pip
70+ pip install --no-cache-dir -r /stackable/python/requirements.txt
71+ groupadd -r ${STACKABLE_USER_NAME} --gid=${STACKABLE_USER_GID}
72+ useradd -r -g ${STACKABLE_USER_NAME} --uid=${STACKABLE_USER_UID} ${STACKABLE_USER_NAME}
73+ chown -R ${STACKABLE_USER_UID}:0 /stackable
74+ EOF
75+
76+ ENV PATH=/stackable/keycloak/bin:$PATH
6977
70- USER stackable
78+ USER ${STACKABLE_USER_UID}
7179
7280ENV STACKABLE_PRODUCT_VERSION=${PRODUCT}
7381
0 commit comments