Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions dev-support/hbase_docker/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Exclude everything by default
*

# But include the files we might need for different INPUT_MODE options
!hbase-src.tar.gz
!hbase
!hbase/**

# The Dockerfile and README are not needed in the image
Dockerfile
README.md
.dockerignore
m1/
40 changes: 37 additions & 3 deletions dev-support/hbase_docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,43 @@ ENV PATH "${JAVA_HOME}/bin:${MAVEN_HOME}/bin:${PATH}"
# Pull down HBase and build it into /root/hbase-bin.
WORKDIR /root
ARG BRANCH_OR_TAG=master
RUN git clone --depth 1 -b ${BRANCH_OR_TAG} https://github.com/apache/hbase.git \
&& \
mvn -T1C clean install -DskipTests assembly:single -f ./hbase/pom.xml \
ARG INPUT_MODE=tag

# INPUT_MODE=tag (default): clones from GitHub; build context files are ignored
# INPUT_MODE=tarball: expects hbase-src.tar.gz in the build context root
# INPUT_MODE=source-dir: expects the HBase source root as the build context
# (use build-hbase.sh --source, which sets this up correctly)
COPY . /tmp/build-context/

# Stage source using the appropriate method
RUN set -e && \
case "${INPUT_MODE}" in \
tag) \
echo "INFO: Cloning HBase from GitHub (branch/tag: ${BRANCH_OR_TAG})" && \
git clone --depth 1 -b "${BRANCH_OR_TAG}" https://github.com/apache/hbase.git \
;; \
tarball) \
echo "INFO: Extracting HBase from tarball" && \
if [ ! -f /tmp/build-context/hbase-src.tar.gz ]; then \
echo "ERROR: hbase-src.tar.gz not found in build context" >&2 && \
exit 1; \
fi && \
mkdir -p hbase && \
tar xzf /tmp/build-context/hbase-src.tar.gz -C hbase --strip-components 1 \
;; \
source-dir) \
echo "INFO: Using HBase source from build context" && \
cp -r /tmp/build-context hbase \
;; \
*) \
echo "ERROR: Invalid INPUT_MODE=${INPUT_MODE}. Must be: tag, tarball, or source-dir" >&2 && \
exit 1 \
;; \
esac && \
rm -rf /tmp/build-context

# Build HBase and extract the assembly
RUN mvn -T1C clean install -DskipTests assembly:single -f ./hbase/pom.xml \
&& \
mkdir -p hbase-bin \
&& \
Expand Down
Loading
Loading