1 # Licensed to the Apache Software Foundation (ASF) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The ASF licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 FROM ubuntu:18.04 AS BASE_IMAGE
18 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
20 # hadolint ignore=DL3009
21 RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
22 DEBIAN_FRONTEND=noninteractive apt-get -qq install --no-install-recommends -y \
23 ca-certificates=20180409 \
24 curl=7.58.0-2ubuntu3.8 \
27 RUN locale-gen en_US.UTF-8
28 ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
30 FROM BASE_IMAGE AS MAVEN_DOWNLOAD_IMAGE
31 ENV MAVEN_VERSION='3.5.4'
32 ENV MAVEN_URL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
33 ENV MAVEN_SHA256 'ce50b1c91364cb77efe3776f756a6d92b76d9038b0a0782f7d53acf1e997a14d'
34 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
35 RUN curl --location --fail --silent --show-error --output /tmp/maven.tar.gz "${MAVEN_URL}" && \
36 echo "${MAVEN_SHA256} */tmp/maven.tar.gz" | sha256sum -c -
38 FROM BASE_IMAGE AS OPENJDK8_DOWNLOAD_IMAGE
39 ENV OPENJDK8_URL 'https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u232-b09/OpenJDK8U-jdk_x64_linux_hotspot_8u232b09.tar.gz'
40 ENV OPENJDK8_SHA256 '7b7884f2eb2ba2d47f4c0bf3bb1a2a95b73a3a7734bd47ebf9798483a7bcc423'
41 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
42 RUN curl --location --fail --silent --show-error --output /tmp/adoptopenjdk8.tar.gz "${OPENJDK8_URL}" && \
43 echo "${OPENJDK8_SHA256} */tmp/adoptopenjdk8.tar.gz" | sha256sum -c -
46 SHELL ["/bin/bash", "-o", "pipefail", "-c"]
48 RUN DEBIAN_FRONTEND=noninteractive apt-get -qq install --no-install-recommends -y \
49 git=1:2.17.1-1ubuntu0.5 \
52 rm -rf /var/lib/apt/lists/*
55 # when updating java or maven versions here, consider also updating
56 # `dev-support/docker/Dockerfile` as well.
59 # hadolint ignore=DL3010
60 COPY --from=MAVEN_DOWNLOAD_IMAGE /tmp/maven.tar.gz /tmp/maven.tar.gz
61 RUN tar xzf /tmp/maven.tar.gz -C /opt && \
62 ln -s "/opt/$(dirname "$(tar -tf /tmp/maven.tar.gz | head -n1)")" /opt/maven && \
65 # hadolint ignore=DL3010
66 COPY --from=OPENJDK8_DOWNLOAD_IMAGE /tmp/adoptopenjdk8.tar.gz /tmp/adoptopenjdk8.tar.gz
67 RUN mkdir -p /usr/lib/jvm && \
68 tar xzf /tmp/adoptopenjdk8.tar.gz -C /usr/lib/jvm && \
69 ln -s "/usr/lib/jvm/$(basename "$(tar -tf /tmp/adoptopenjdk8.tar.gz | head -n1)")" /usr/lib/jvm/java-8-adoptopenjdk && \
70 ln -s /usr/lib/jvm/java-8-adoptopenjdk /usr/lib/jvm/java-8 && \
71 rm /tmp/adoptopenjdk8.tar.gz
73 ENV MAVEN_HOME '/opt/maven'
74 ENV JAVA_HOME '/usr/lib/jvm/java-8'
75 ENV PATH '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
76 ENV PATH "${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${PATH}"
78 # Pull down HBase and build it into /root/hbase-bin.
80 RUN git clone https://gitbox.apache.org/repos/asf/hbase.git -b master
81 RUN mvn clean install -DskipTests assembly:single -f ./hbase/pom.xml
82 RUN mkdir -p hbase-bin
83 RUN find /root/hbase/hbase-assembly/target -iname '*.tar.gz' -not -iname '*client*' \
85 | xargs -I{} tar xzf {} --strip-components 1 -C /root/hbase-bin
87 # Set HBASE_HOME, add it to the path, and start HBase.
88 ENV HBASE_HOME /root/hbase-bin
89 ENV PATH "/root/hbase-bin/bin:${PATH}"
91 CMD ["/bin/bash", "-c", "start-hbase.sh; hbase shell"]