Skip to content

Commit 4fc45a3

Browse files
Ayush PatelAyush Patel
authored andcommitted
fix: Replace removed openjdk:8 image in hive Dockerfile
Port upstream fix: install curl directly in apache/hive:4.0.0 instead of multi-stage build from openjdk:8-jre-slim which was removed from Docker Hub.
1 parent 0a7325a commit 4fc45a3

1 file changed

Lines changed: 21 additions & 12 deletions

File tree

dev/hive/Dockerfile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,30 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
FROM openjdk:8-jre-slim AS build
17-
18-
RUN apt-get update -qq && apt-get -qq -y install curl
16+
FROM apache/hive:4.0.0
1917

20-
ENV HADOOP_VERSION=3.3.6
21-
ENV AWS_SDK_BUNDLE=1.12.753
18+
# Dependency versions - changing these invalidates the JAR download layer
19+
ARG HADOOP_VERSION=3.3.6
20+
ARG AWS_SDK_BUNDLE=1.12.753
21+
ARG MAVEN_MIRROR=https://repo1.maven.org/maven2
2222

23-
RUN curl https://repo1.maven.org/maven2/org/apache/hadoop/hadoop-aws/${HADOOP_VERSION}/hadoop-aws-${HADOOP_VERSION}.jar -Lo /tmp/hadoop-aws-${HADOOP_VERSION}.jar
24-
RUN curl https://repo1.maven.org/maven2/com/amazonaws/aws-java-sdk-bundle/${AWS_SDK_BUNDLE}/aws-java-sdk-bundle-${AWS_SDK_BUNDLE}.jar -Lo /tmp/aws-java-sdk-bundle-${AWS_SDK_BUNDLE}.jar
23+
USER root
2524

26-
FROM apache/hive:4.0.0
25+
# Install curl (separate layer - rarely changes)
26+
RUN apt-get update -qq && \
27+
apt-get -qq -y install --no-install-recommends curl && \
28+
apt-get clean && \
29+
rm -rf /var/lib/apt/lists/*
2730

28-
ENV HADOOP_VERSION=3.3.6
29-
ENV AWS_SDK_BUNDLE=1.12.753
31+
# Download JARs with retry logic (slow layer - only changes when versions change)
32+
RUN curl -fsSL --retry 3 --retry-delay 5 \
33+
-o /opt/hive/lib/hadoop-aws-${HADOOP_VERSION}.jar \
34+
"${MAVEN_MIRROR}/org/apache/hadoop/hadoop-aws/${HADOOP_VERSION}/hadoop-aws-${HADOOP_VERSION}.jar" && \
35+
curl -fsSL --retry 3 --retry-delay 5 \
36+
-o /opt/hive/lib/aws-java-sdk-bundle-${AWS_SDK_BUNDLE}.jar \
37+
"${MAVEN_MIRROR}/com/amazonaws/aws-java-sdk-bundle/${AWS_SDK_BUNDLE}/aws-java-sdk-bundle-${AWS_SDK_BUNDLE}.jar"
3038

31-
COPY --from=build /tmp/hadoop-aws-${HADOOP_VERSION}.jar /opt/hive/lib/hadoop-aws-${HADOOP_VERSION}.jar
32-
COPY --from=build /tmp/aws-java-sdk-bundle-${AWS_SDK_BUNDLE}.jar /opt/hive/lib/aws-java-sdk-bundle-${AWS_SDK_BUNDLE}.jar
39+
# Copy configuration last (changes more frequently than JARs)
3340
COPY core-site.xml /opt/hadoop/etc/hadoop/core-site.xml
41+
42+
USER hive

0 commit comments

Comments
 (0)