ayushkhare12

Harisekhon Impala

Sep 17th, 2019
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.84 KB | None | 0 0
  1. #
  2. #  Author: Hari Sekhon
  3. #  Date: 2016-01-16 09:58:07 +0000 (Sat, 16 Jan 2016)
  4. #
  5. #  vim:ts=4:sts=4:sw=4:et
  6. #
  7. #  https://github.com/harisekhon/Dockerfiles
  8. #
  9. #  If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
  10. #
  11. #  https://www.linkedin.com/in/harisekhon
  12. #
  13.  
  14. FROM alpine:latest
  15. MAINTAINER Hari Sekhon (https://www.linkedin.com/in/harisekhon)
  16.  
  17. ARG APACHE_DRILL_VERSION=1.15.0
  18.  
  19. ARG TAR=apache-drill-${APACHE_DRILL_VERSION}.tar.gz
  20.  
  21. ENV DRILL_HEAP=900M
  22.  
  23. # -e ZOOKEEPER_HOST if clustering these containers with external contained linked zookeeper
  24. ENV ZOOKEEPER_HOST=zookeeper
  25.  
  26. ENV PATH $PATH:/apache-drill/bin:/zookeeper/bin
  27.  
  28. LABEL Description="Apache Drill" \
  29.       "Apache Drill Version"="$APACHE_DRILL_VERSION"
  30.  
  31. WORKDIR /
  32.  
  33. # bash       => entrypoint.sh
  34. # java       => apache drill engine
  35. # supervisor => drillbit standalone runner for nagios checks
  36. # which      => drill-embedded script
  37. RUN set -euxo pipefail && \
  38.     apk add --no-cache bash openjdk8 supervisor which && \
  39.     mkdir -p /etc/supervisor.d
  40.  
  41. RUN set -euxo pipefail && \
  42.     apk add --no-cache wget tar && \
  43.     url="http://www.apache.org/dyn/closer.lua?filename=drill/drill-${APACHE_DRILL_VERSION}/${TAR}&action=download"; \
  44.     url_archive="http://archive.apache.org/dist/drill/drill-${APACHE_DRILL_VERSION}/${TAR}"; \
  45.     # --max-redirect - some apache mirrors redirect a couple times and give you the latest version instead
  46.     #                  but this breaks stuff later because the link will not point to the right dir
  47.     #                  (and is also the wrong version for the tag)
  48.     wget -t 10 --max-redirect 1 --retry-connrefused -O "${TAR}" "$url" || \
  49.     wget -t 10 --max-redirect 1 --retry-connrefused -O "${TAR}" "$url_archive" && \
  50.     tar zxf "${TAR}" && \
  51.     # check tarball was extracted to the right place, helps ensure it's the right version and the link will work
  52.     test -d "apache-drill-${APACHE_DRILL_VERSION}" && \
  53.     rm -fv  "${TAR}" && \
  54.     ln -sv "apache-drill-${APACHE_DRILL_VERSION}" apache-drill && \
  55.     apk del tar wget
  56.  
  57. # need to keep this here to make it easier to launch supervisor with just a ZOOKEEPER_HOST and DRILL_HEAP environment variables
  58. RUN set -euxo pipefail && \
  59.     # for older versions
  60.     sed -i -e "s/-Xms1G/-Xms\$DRILL_MAX_HEAP/" apache-drill/conf/drill-env.sh && \
  61.     sed -i -e "s/^DRILL_MAX_HEAP=.*/DRILL_MAX_HEAP=\"${DRILL_HEAP}\"/" apache-drill/conf/drill-env.sh && \
  62.     \
  63.     sed -i -e "s/^DRILL_HEAP=.*/DRILL_HEAP=\"${DRILL_HEAP}\"/" apache-drill/conf/drill-env.sh && \
  64.     sed -i -e "s/^\([[:space:]]*\)zk.connect:.*/\\1zk.connect: \"${ZOOKEEPER_HOST}\"/" apache-drill/conf/drill-override.conf
  65.  
  66. COPY entrypoint.sh /
  67. COPY supervisord.d/drill.ini /etc/supervisor.d/
  68.  
  69. EXPOSE 8047
  70.  
  71. CMD /entrypoint.sh
Add Comment
Please, Sign In to add comment