@@ -12,19 +12,20 @@ FROM stackable/image/java-devel AS hive-builder
12
12
ARG PRODUCT
13
13
ARG HADOOP
14
14
ARG JMX_EXPORTER
15
+ ARG STACKABLE_USER_UID
15
16
16
17
# Setting this to anything other than "true" will keep the cache folders around (e.g. for Maven, NPM etc.)
17
18
# This can be used to speed up builds when disk space is of no concern.
18
19
ARG DELETE_CACHES="true"
19
20
20
- COPY --chown=stackable:stackable hive/stackable /stackable
21
+ COPY --chown=${STACKABLE_USER_UID}:0 hive/stackable /stackable
21
22
22
- USER stackable
23
+ USER ${STACKABLE_USER_UID}
23
24
WORKDIR /stackable
24
25
25
26
# Cache mounts are owned by root by default
26
- # We need to explicitly give the uid to use which is hardcoded to "1000" in stackable-base
27
- RUN --mount=type=cache,id=maven-hive,uid=1000 ,target=/stackable/.m2/repository <<EOF
27
+ # We need to explicitly give the uid to use
28
+ RUN --mount=type=cache,id=maven-hive-${PRODUCT} ,uid=${STACKABLE_USER_UID} ,target=/stackable/.m2/repository <<EOF
28
29
curl --fail -L "https://repo.stackable.tech/repository/packages/hive/apache-hive-${PRODUCT}-src.tar.gz" | tar -xzC .
29
30
30
31
patches/apply_patches.sh ${PRODUCT}
@@ -76,6 +77,7 @@ ARG RELEASE
76
77
ARG AWS_JAVA_SDK_BUNDLE
77
78
ARG AZURE_STORAGE
78
79
ARG AZURE_KEYVAULT_CORE
80
+ ARG STACKABLE_USER_UID
79
81
80
82
81
83
ARG NAME="Apache Hive metastore"
@@ -107,16 +109,16 @@ rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" | sort > /stackable/package_manif
107
109
rm -rf /var/cache/yum
108
110
EOF
109
111
110
- USER stackable
112
+ USER ${STACKABLE_USER_UID}
111
113
WORKDIR /stackable
112
114
113
- COPY --chown=stackable:stackable --from=hive-builder /stackable/apache-hive-metastore-${PRODUCT}-bin /stackable/apache-hive-metastore-${PRODUCT}-bin
115
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hive-builder /stackable/apache-hive-metastore-${PRODUCT}-bin /stackable/apache-hive-metastore-${PRODUCT}-bin
114
116
RUN ln -s /stackable/apache-hive-metastore-${PRODUCT}-bin /stackable/hive-metastore
115
117
116
118
# It is useful to see which version of Hadoop is used at a glance
117
119
# Therefore the use of the full name here
118
120
# TODO: Do we really need all of Hadoop in here?
119
- COPY --chown=stackable:stackable --from=hadoop-builder /stackable/hadoop /stackable/hadoop-${HADOOP}
121
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hadoop-builder /stackable/hadoop /stackable/hadoop-${HADOOP}
120
122
RUN ln -s /stackable/hadoop-${HADOOP} /stackable/hadoop
121
123
122
124
# The next two sections for S3 and Azure use hardcoded version numbers on purpose instead of wildcards
@@ -131,7 +133,7 @@ RUN cp /stackable/hadoop/share/hadoop/tools/lib/hadoop-azure-${HADOOP}.jar /stac
131
133
RUN cp /stackable/hadoop/share/hadoop/tools/lib/azure-storage-${AZURE_STORAGE}.jar /stackable/hive-metastore/lib/
132
134
RUN cp /stackable/hadoop/share/hadoop/tools/lib/azure-keyvault-core-${AZURE_KEYVAULT_CORE}.jar /stackable/hive-metastore/lib/
133
135
134
- COPY --chown=stackable:stackable --from=hive-builder /stackable/jmx /stackable/jmx
136
+ COPY --chown=${STACKABLE_USER_UID}:0 --from=hive-builder /stackable/jmx /stackable/jmx
135
137
COPY hive/licenses /licenses
136
138
137
139
ENV HADOOP_HOME=/stackable/hadoop
0 commit comments