-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
aidar
committed
Jun 25, 2017
1 parent
4812589
commit aa79313
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM openjdk:8-jre-alpine | ||
MAINTAINER Aidar Bariev <aidarbariev@gmail.com> | ||
|
||
RUN apk add --no-cache \ | ||
bash \ | ||
su-exec | ||
|
||
ENV HBASE_DATA_DIR=/data | ||
|
||
ARG VERSION=1.3.1 | ||
ARG HBASE_NAME=hbase-$VERSION | ||
ARG DISTRO_NAME=$HBASE_NAME-bin | ||
|
||
RUN set -x \ | ||
&& wget -q "http://www.apache.org/dist/hbase/$VERSION/$DISTRO_NAME.tar.gz" \ | ||
&& tar -xzf "$DISTRO_NAME.tar.gz" \ | ||
&& rm -r "$DISTRO_NAME.tar.gz" \ | ||
&& rm $HBASE_NAME/conf/hbase-site.xml | ||
|
||
WORKDIR $HBASE_NAME | ||
VOLUME ["$HBASE_DATA_DIR"] | ||
|
||
EXPOSE 60000 60010 | ||
|
||
COPY docker-entrypoint.sh / | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["bin/hbase", "master", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Generate the config only if it doesn't exist | ||
if [ ! -f "conf/hbase-site.xml" ]; then | ||
CONFIG="conf/hbase-site.xml" | ||
|
||
echo "<?xml version=\"1.0\"?>" >> $CONFIG | ||
echo "<?xml-stylesheet type=\"text/xsl\" href=\"configuration.xsl\"?>" >> $CONFIG | ||
echo "<configuration>" >> $CONFIG | ||
echo "<property><name>hbase.rootdir</name><value>file://$HBASE_DATA_DIR/hbase</value></property>" >> $CONFIG | ||
echo "<property><name>hbase.zookeeper.property.dataDir</name><value>file://$HBASE_DATA_DIR/zookeeper</value></property>" >> $CONFIG | ||
echo "</configuration>" >> $CONFIG | ||
fi | ||
|
||
exec "$@" |