Skip to content

Commit 181b807

Browse files
Apache9petersomogyi
authored andcommitted
HBASE-27459 Improve our hbase_docker to be able to build and start standalone clusters other than master branch (apache#4861)
Signed-off-by: Yulin Niu <niuyulin@apache.org> (cherry picked from commit d78d404) (cherry picked from commit fc03580) Change-Id: I80be0d4b2c5630949bc25d824cb74fd4f5c6a5c9
1 parent 8dc276b commit 181b807

2 files changed

Lines changed: 20 additions & 19 deletions

File tree

dev-support/hbase_docker/Dockerfile

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
FROM ubuntu:18.04 AS BASE_IMAGE
17+
FROM ubuntu:22.04 AS BASE_IMAGE
1818
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
1919

2020
RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
2121
DEBIAN_FRONTEND=noninteractive apt-get -qq install --no-install-recommends -y \
22-
ca-certificates=20180409 \
23-
curl='7.58.0-*' \
24-
git='1:2.17.1-*' \
25-
locales='2.27-*' \
22+
ca-certificates=20211016 \
23+
curl='7.81.0-*' \
24+
git='1:2.34.1-*' \
25+
locales='2.35-*' \
2626
&& \
2727
apt-get clean && \
2828
rm -rf /var/lib/apt/lists/* \
@@ -31,16 +31,16 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -qq update && \
3131
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
3232

3333
FROM BASE_IMAGE AS MAVEN_DOWNLOAD_IMAGE
34-
ENV MAVEN_VERSION='3.6.3'
34+
ENV MAVEN_VERSION='3.8.6'
3535
ENV MAVEN_URL "https://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/apache-maven-${MAVEN_VERSION}-bin.tar.gz"
36-
ENV MAVEN_SHA512 'c35a1803a6e70a126e80b2b3ae33eed961f83ed74d18fcd16909b2d44d7dada3203f1ffe726c17ef8dcca2dcaa9fca676987befeadc9b9f759967a8cb77181c0'
36+
ENV MAVEN_SHA512 'f790857f3b1f90ae8d16281f902c689e4f136ebe584aba45e4b1fa66c80cba826d3e0e52fdd04ed44b4c66f6d3fe3584a057c26dfcac544a60b301e6d0f91c26'
3737
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
3838
RUN curl --location --fail --silent --show-error --output /tmp/maven.tar.gz "${MAVEN_URL}" && \
3939
echo "${MAVEN_SHA512} */tmp/maven.tar.gz" | sha512sum -c -
4040

4141
FROM BASE_IMAGE AS OPENJDK8_DOWNLOAD_IMAGE
42-
ENV OPENJDK8_URL 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u345-b01/OpenJDK8U-jdk_x64_linux_hotspot_8u345b01.tar.gz'
43-
ENV OPENJDK8_SHA256 'ed6c9db3719895584fb1fd69fc79c29240977675f26631911c5a1dbce07b7d58'
42+
ENV OPENJDK8_URL 'https://github.com/adoptium/temurin8-binaries/releases/download/jdk8u352-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u352b08.tar.gz'
43+
ENV OPENJDK8_SHA256 '1633bd7590cb1cd72f5a1378ae8294451028b274d798e2a4ac672059a2f00fee'
4444
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4545
RUN curl --location --fail --silent --show-error --output /tmp/adoptopenjdk8.tar.gz "${OPENJDK8_URL}" && \
4646
echo "${OPENJDK8_SHA256} */tmp/adoptopenjdk8.tar.gz" | sha256sum -c -
@@ -74,9 +74,10 @@ ENV PATH "${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${PATH}"
7474

7575
# Pull down HBase and build it into /root/hbase-bin.
7676
WORKDIR /root
77-
RUN git clone https://gitbox.apache.org/repos/asf/hbase.git -b master \
77+
ARG BRANCH_OR_TAG=master
78+
RUN git clone --depth 1 -b ${BRANCH_OR_TAG} https://github.com/apache/hbase.git \
7879
&& \
79-
mvn clean install -DskipTests assembly:single -f ./hbase/pom.xml \
80+
mvn -T1C clean install -DskipTests assembly:single -f ./hbase/pom.xml \
8081
&& \
8182
mkdir -p hbase-bin \
8283
&& \

dev-support/hbase_docker/README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ under the License.
2222
## Overview
2323

2424
The Dockerfile in this folder can be used to build a Docker image running
25-
the latest HBase master branch in standalone mode. It does this by setting
26-
up necessary dependencies, checking out the master branch of HBase from
27-
GitHub, and then building HBase. By default, this image will start the HMaster
28-
and launch the HBase shell when run.
25+
a specific HBase branch or tag(default to master) in standalone mode. It
26+
does this by setting up necessary dependencies, checking out the specific
27+
branch or tag of HBase from GitHub, and then building HBase. By default,
28+
this image will start the HMaster and launch the HBase shell when run.
2929

3030
## Usage
3131

3232
1. Ensure that you have a recent version of Docker installed from
3333
[docker.io](http://www.docker.io).
3434
1. Set this folder as your working directory.
35-
1. Type `docker build -t hbase_docker .` to build a Docker image called **hbase_docker**.
36-
This may take 10 minutes or more the first time you run the command since it will
37-
create a Maven repository inside the image as well as checkout the master branch
38-
of HBase.
35+
1. Type `docker build -t hbase_docker --build-arg BRANCH_OR_TAG=<branch or tag>.`
36+
to build a Docker image called **hbase_docker**. This may take 10 minutes
37+
or more the first time you run the command since it will create a Maven
38+
repository inside the image as well as checkout the master branch of HBase.
3939
1. When this completes successfully, you can run `docker run -it hbase_docker`
4040
to access an HBase shell running inside of a container created from the
4141
**hbase_docker** image. Alternatively, you can type `docker run -it hbase_docker

0 commit comments

Comments
 (0)