Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.

Commit 6c57050

Browse files
committed
[hack] move hive & hadoop image to docker-hub and its Dockerfile
1 parent 4ebaab6 commit 6c57050

File tree

3 files changed

+99
-2
lines changed

3 files changed

+99
-2
lines changed

hack/Dockerfile.hadoop

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM alpine:3.10 AS downloader
2+
3+
WORKDIR /build
4+
RUN apk add -U curl gnupg tar
5+
6+
# Main Apache distributions:
7+
# * https://apache.org/dist
8+
# * https://archive.apache.org/dist
9+
# * https://dist.apache.org/repos/dist/release
10+
# List all Apache mirrors:
11+
# * https://apache.org/mirrors
12+
ARG APACHE_DIST=https://archive.apache.org/dist
13+
ARG APACHE_MIRROR=${APACHE_DIST}
14+
ARG HADOOP_VERSION=3.3.0
15+
16+
RUN set -eux; \
17+
curl -L "${APACHE_DIST}/hadoop/common/KEYS" | gpg --batch --import -; \
18+
curl -LO "${APACHE_MIRROR}/hadoop/common/hadoop-${HADOOP_VERSION}/hadoop-${HADOOP_VERSION}.tar.gz"; \
19+
curl -L "${APACHE_DIST}/hadoop/common/hadoop-${HADOOP_VERSION}/hadoop-${HADOOP_VERSION}.tar.gz.asc" \
20+
| gpg --batch --verify - "hadoop-${HADOOP_VERSION}.tar.gz";
21+
RUN tar -xf "hadoop-${HADOOP_VERSION}.tar.gz" --no-same-owner \
22+
--exclude="hadoop-*/share/doc"; \
23+
mv "hadoop-${HADOOP_VERSION}" "hadoop";
24+
25+
26+
27+
FROM ubuntu:focal
28+
LABEL maintainer="Dũng Đặng Minh <[email protected]>"
29+
SHELL [ "/bin/bash", "-c" ]
30+
31+
RUN set -eux; \
32+
apt-get update; \
33+
apt-get install -y --no-install-recommends \
34+
openjdk-8-jre-headless ca-certificates libc6 \
35+
libbz2-1.0 liblz4-1 libsnappy1v5 zlib1g libzstd1 \
36+
libssl1.1 libisal2 libnss3 libpam-modules krb5-user procps; \
37+
ln -s libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so; \
38+
ln -s libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so; \
39+
apt-get clean; \
40+
rm -rf /var/lib/apt/lists/*
41+
42+
# TODO: Native Hadoop Library
43+
# > hadoop checknative -a
44+
# * libbz2-1.0 liblz4-1 libsnappy1v5 zlib1g libzstd1
45+
# * libssl1.1
46+
# ln -s libcrypto.so.1.1 /usr/lib/x86_64-linux-gnu/libcrypto.so
47+
# ln -s libssl.so.1.1 /usr/lib/x86_64-linux-gnu/libssl.so
48+
# * libisal2
49+
# ln -s libisal.so.2 /usr/lib/x86_64-linux-gnu/libisal.so
50+
51+
ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" \
52+
HADOOP_HOME="/opt/hadoop"
53+
54+
COPY --from=downloader "/build/hadoop" "${HADOOP_HOME}"
55+
56+
ENV PATH="${HADOOP_HOME}/bin:${PATH}" \
57+
LD_LIBRARY_PATH="${HADOOP_HOME}/lib/native:${LD_LIBRARY_PATH}"

hack/Dockerfile.hive

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
ARG HADOOP_VERSION=3.1.0
2+
3+
FROM alpine:3.10 AS downloader
4+
5+
WORKDIR /build
6+
RUN apk add -U curl gnupg tar
7+
8+
# Main Apache distributions:
9+
# * https://apache.org/dist
10+
# * https://archive.apache.org/dist
11+
# * https://dist.apache.org/repos/dist/release
12+
# List all Apache mirrors:
13+
# * https://apache.org/mirrors
14+
ARG APACHE_DIST=https://archive.apache.org/dist
15+
ARG APACHE_MIRROR=${APACHE_DIST}
16+
ARG HIVE_VERSION=3.1.2
17+
18+
RUN set -eux; \
19+
curl -L "${APACHE_DIST}/hive/KEYS" | gpg --batch --import -; \
20+
curl -LO "${APACHE_MIRROR}/hive/hive-${HIVE_VERSION}/apache-hive-${HIVE_VERSION}-bin.tar.gz"; \
21+
curl -L "${APACHE_DIST}/hive/hive-${HIVE_VERSION}/apache-hive-${HIVE_VERSION}-bin.tar.gz.asc" \
22+
| gpg --batch --verify - "apache-hive-${HIVE_VERSION}-bin.tar.gz";
23+
RUN tar -xf "apache-hive-${HIVE_VERSION}-bin.tar.gz" --no-same-owner; \
24+
mv "apache-hive-${HIVE_VERSION}-bin" "hive";
25+
26+
27+
28+
FROM dungdm93/hadoop:${HADOOP_VERSION}
29+
30+
# Tools
31+
RUN set -eux; \
32+
apt-get update; \
33+
apt-get install -y netcat; \
34+
apt-get clean; \
35+
rm -rf /var/lib/apt/lists/*
36+
37+
ENV HIVE_HOME="/opt/hive" \
38+
PATH="/opt/hive/bin:${PATH}"
39+
40+
COPY --from=downloader "/build/hive" "${HIVE_HOME}"

hack/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
- postgres_data:/var/lib/postgresql/data
3333

3434
hive-metastore:
35-
image: hub.teko.vn/data/hive:3.1.2-hadoop-3.1.0
35+
image: dungdm93/hive:3.1.2
3636
# HOTFIX: Illegal character in hostname at index 13: thrift://hive_hive-metastore_1.bookshelf:9083
3737
# Caused at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.resolveUris(HiveMetaStoreClient.java:267)
3838
container_name: hive-metastore
@@ -49,7 +49,7 @@ services:
4949
- warehouse_data:/data/warehouse
5050

5151
hive-server2:
52-
image: hub.teko.vn/data/hive:3.1.2-hadoop-3.1.0
52+
image: dungdm93/hive:3.1.2
5353
entrypoint: ["/usr/local/scripts/hiveserver2-entrypoint.sh"]
5454
depends_on:
5555
- hive-metastore

0 commit comments

Comments
 (0)