diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..ec40e25ee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +build +.git +.tablesawcache +.travis.yml +Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e69d5bbe1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +ARG KAIROSDB_VERSION=1.3.0-0.1beta + +FROM openjdk:8-jdk-slim-stretch as build +ARG KAIROSDB_VERSION + +WORKDIR /home/kairosdb +ADD . /home/kairosdb/git + +RUN cd git && \ + export CLASSPATH=tools/tablesaw-1.2.7.jar && \ + java make package + +RUN tar -xzvf git/build/kairosdb-${KAIROSDB_VERSION}.tar.gz + +FROM openjdk:8-jre-slim-stretch +ARG KAIROSDB_VERSION +ENV KAIROSDB_HOME=/opt/kairosdb-${KAIROSDB_VERSION} +ENV CLASSPATH=${KAIROSDB_HOME}/lib/* + +COPY --from=build /home/kairosdb/kairosdb /opt/kairosdb-${KAIROSDB_VERSION} + +RUN ln -s ${KAIROSDB_HOME}/conf /etc/kairosdb && \ + echo 'export PATH=${KAIROSDB_HOME}/bin:${PATH}' >> /root/.bashrc + +EXPOSE 8080 4242 + +WORKDIR /opt/kairosdb-${KAIROSDB_VERSION}/bin +ENTRYPOINT . ~/.bashrc && kairosdb.sh run \ No newline at end of file diff --git a/how_to_build.txt b/how_to_build.txt index ee5bf027c..b44b47de6 100644 --- a/how_to_build.txt +++ b/how_to_build.txt @@ -8,3 +8,7 @@ Then to build type You can also get help on what targets are available by typing >java make help + +If you prefer to use docker you can easily run the following commands from the top folder of this repository: +>docker build -t kairosdb:1.3.0_beta1 . +>docker run -it --rm -p 0.0.0.0:8080:8080 -p 0.0.0.0:4242:4242 kairosdb:1.3.0_beta1 \ No newline at end of file