Skip to content

Commit 682a945

Browse files
committed
WIP Fix Hive
1 parent 7c2703e commit 682a945

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

hive/Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@ FROM stackable/image/java-devel AS hive-builder
1212
ARG PRODUCT
1313
ARG HADOOP
1414
ARG JMX_EXPORTER
15+
ARG STACKABLE_USER_UID
1516

1617
# Setting this to anything other than "true" will keep the cache folders around (e.g. for Maven, NPM etc.)
1718
# This can be used to speed up builds when disk space is of no concern.
1819
ARG DELETE_CACHES="true"
1920

20-
COPY --chown=stackable:stackable hive/stackable /stackable
21+
COPY --chown=${STACKABLE_USER_UID}:0 hive/stackable /stackable
2122

22-
USER stackable
23+
USER ${STACKABLE_USER_UID}
2324
WORKDIR /stackable
2425

2526
# 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
2829
curl --fail -L "https://repo.stackable.tech/repository/packages/hive/apache-hive-${PRODUCT}-src.tar.gz" | tar -xzC .
2930

3031
patches/apply_patches.sh ${PRODUCT}
@@ -76,6 +77,7 @@ ARG RELEASE
7677
ARG AWS_JAVA_SDK_BUNDLE
7778
ARG AZURE_STORAGE
7879
ARG AZURE_KEYVAULT_CORE
80+
ARG STACKABLE_USER_UID
7981

8082

8183
ARG NAME="Apache Hive metastore"
@@ -107,16 +109,16 @@ rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}\n" | sort > /stackable/package_manif
107109
rm -rf /var/cache/yum
108110
EOF
109111

110-
USER stackable
112+
USER ${STACKABLE_USER_UID}
111113
WORKDIR /stackable
112114

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
114116
RUN ln -s /stackable/apache-hive-metastore-${PRODUCT}-bin /stackable/hive-metastore
115117

116118
# It is useful to see which version of Hadoop is used at a glance
117119
# Therefore the use of the full name here
118120
# 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}
120122
RUN ln -s /stackable/hadoop-${HADOOP} /stackable/hadoop
121123

122124
# 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
131133
RUN cp /stackable/hadoop/share/hadoop/tools/lib/azure-storage-${AZURE_STORAGE}.jar /stackable/hive-metastore/lib/
132134
RUN cp /stackable/hadoop/share/hadoop/tools/lib/azure-keyvault-core-${AZURE_KEYVAULT_CORE}.jar /stackable/hive-metastore/lib/
133135

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
135137
COPY hive/licenses /licenses
136138

137139
ENV HADOOP_HOME=/stackable/hadoop

0 commit comments

Comments
 (0)