├── LATEST ├── docs └── .gitkeep ├── 5.5 ├── VERSION ├── .dockerignore ├── config │ ├── logrotate │ └── elastic │ │ ├── log4j2.properties │ │ └── elasticsearch.yml ├── docker-healthcheck ├── Dockerfile └── elastic-entrypoint.sh ├── .circleci ├── SIZE ├── build_num └── config.yml ├── x-pack ├── VERSION ├── Dockerfile └── hooks │ └── post_push ├── 6.6 ├── .dockerignore ├── Dockerfile └── hooks │ └── post_push ├── 7.0 ├── .dockerignore ├── Dockerfile └── hooks │ └── post_push ├── .gitignore ├── es-logo.png ├── 6.5 ├── Dockerfile └── hooks │ └── post_push ├── 5.6 ├── .dockerignore ├── config │ ├── logrotate │ └── elastic │ │ ├── log4j2.properties │ │ └── elasticsearch.yml ├── docker-healthcheck ├── Dockerfile └── elastic-entrypoint.sh ├── 6.0 ├── .dockerignore ├── config │ ├── logrotate │ └── elastic │ │ ├── log4j2.properties │ │ └── elasticsearch.yml ├── docker-healthcheck ├── Dockerfile └── elastic-entrypoint.sh ├── 6.3 ├── .dockerignore ├── config │ ├── logrotate │ └── elastic │ │ ├── log4j2.properties │ │ └── elasticsearch.yml ├── hooks │ └── post_push ├── docker-healthcheck ├── elastic-entrypoint.sh └── Dockerfile ├── 6.4 ├── .dockerignore ├── config │ ├── logrotate │ ├── log4j2.properties │ └── elasticsearch.yml ├── hooks │ └── post_push ├── healthcheck ├── entrypoint.sh └── Dockerfile ├── .dockerignore ├── CHANGELOG.md ├── hack └── make │ ├── tag │ └── dockerfile ├── README.md ├── Makefile └── LICENSE /LATEST: -------------------------------------------------------------------------------- 1 | 7.0 -------------------------------------------------------------------------------- /docs/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /5.5/VERSION: -------------------------------------------------------------------------------- 1 | 5.5 2 | -------------------------------------------------------------------------------- /.circleci/SIZE: -------------------------------------------------------------------------------- 1 | 123MB 2 | -------------------------------------------------------------------------------- /.circleci/build_num: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /x-pack/VERSION: -------------------------------------------------------------------------------- 1 | x-pack 2 | -------------------------------------------------------------------------------- /6.6/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | hooks -------------------------------------------------------------------------------- /7.0/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | hooks -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | *.tgz 3 | *.bu 4 | 5 | .vagrant/ 6 | .circleci/build_num 7 | -------------------------------------------------------------------------------- /es-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maliceio/elasticsearch/HEAD/es-logo.png -------------------------------------------------------------------------------- /6.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM blacktop/elasticsearch:6.5 2 | 3 | LABEL maintainer "https://github.com/maliceio" 4 | 5 | ENV VERSION 6.5.0 6 | -------------------------------------------------------------------------------- /6.6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM blacktop/elasticsearch:6.6.1 2 | 3 | LABEL maintainer "https://github.com/maliceio" 4 | 5 | ENV VERSION 6.6.1 6 | -------------------------------------------------------------------------------- /7.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM blacktop/elasticsearch:7.0.0 2 | 3 | LABEL maintainer "https://github.com/maliceio" 4 | 5 | ENV VERSION 7.0.0 6 | -------------------------------------------------------------------------------- /x-pack/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM blacktop/elasticsearch:x-pack 2 | 3 | LABEL maintainer "https://github.com/maliceio" 4 | 5 | ENV ELASTICSEARCH_VERSION 7.0.0 -------------------------------------------------------------------------------- /5.5/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | es-logo.png 6 | LICENSE 7 | README.md 8 | docker-compose.yml 9 | .DS_Store 10 | build 11 | release 12 | Makefile 13 | -------------------------------------------------------------------------------- /5.6/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | es-logo.png 6 | LICENSE 7 | README.md 8 | docker-compose.yml 9 | .DS_Store 10 | build 11 | release 12 | Makefile 13 | -------------------------------------------------------------------------------- /6.0/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | es-logo.png 6 | LICENSE 7 | README.md 8 | docker-compose.yml 9 | .DS_Store 10 | build 11 | release 12 | Makefile 13 | -------------------------------------------------------------------------------- /6.3/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | es-logo.png 6 | LICENSE 7 | README.md 8 | docker-compose.yml 9 | .DS_Store 10 | build 11 | release 12 | Makefile 13 | -------------------------------------------------------------------------------- /6.4/.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | 5 | es-logo.png 6 | LICENSE 7 | README.md 8 | docker-compose.yml 9 | .DS_Store 10 | build 11 | release 12 | Makefile 13 | -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | # Ignore .git folder 2 | .git* 3 | .gitignore 4 | .gitmodules 5 | 6 | .circleci* 7 | docs* 8 | tests* 9 | hooks* 10 | 11 | README.md 12 | README.md.bu 13 | LICENSE 14 | CHANGELOG.md 15 | Makefile 16 | NOTES.md 17 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | Change Log 2 | ========== 3 | 4 | All notable changes to this project will be documented in this file. 5 | 6 | [5.5] - 7 | ------------------ 8 | 9 | ### Fixed 10 | 11 | ### Added 12 | 13 | ### Removed 14 | 15 | ### Changed 16 | -------------------------------------------------------------------------------- /5.5/config/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/elasticsearch/*.log { 2 | daily 3 | rotate 50 4 | size 50M 5 | copytruncate 6 | compress 7 | delaycompress 8 | missingok 9 | notifempty 10 | create 644 elasticsearch elasticsearch 11 | } 12 | -------------------------------------------------------------------------------- /5.6/config/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/elasticsearch/*.log { 2 | daily 3 | rotate 50 4 | size 50M 5 | copytruncate 6 | compress 7 | delaycompress 8 | missingok 9 | notifempty 10 | create 644 elasticsearch elasticsearch 11 | } 12 | -------------------------------------------------------------------------------- /6.0/config/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/elasticsearch/*.log { 2 | daily 3 | rotate 50 4 | size 50M 5 | copytruncate 6 | compress 7 | delaycompress 8 | missingok 9 | notifempty 10 | create 644 elasticsearch elasticsearch 11 | } 12 | -------------------------------------------------------------------------------- /6.3/config/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/elasticsearch/*.log { 2 | daily 3 | rotate 50 4 | size 50M 5 | copytruncate 6 | compress 7 | delaycompress 8 | missingok 9 | notifempty 10 | create 644 elasticsearch elasticsearch 11 | } 12 | -------------------------------------------------------------------------------- /6.4/config/logrotate: -------------------------------------------------------------------------------- 1 | /var/log/elasticsearch/*.log { 2 | daily 3 | rotate 50 4 | size 50M 5 | copytruncate 6 | compress 7 | delaycompress 8 | missingok 9 | notifempty 10 | create 644 elasticsearch elasticsearch 11 | } 12 | -------------------------------------------------------------------------------- /hack/make/tag: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | TAG=$(cat "$BUILD/Dockerfile" | grep '^ENV VERSION' | cut -d" " -f3) 6 | 7 | echo "===> Tagging $ORG/$NAME:$BUILD as $ORG/$NAME:$TAG" 8 | docker tag $ORG/$NAME:$BUILD $ORG/$NAME:$TAG 9 | echo "===> Pushing $ORG/$NAME:$TAG" 10 | docker push $ORG/$NAME:$TAG 11 | -------------------------------------------------------------------------------- /6.4/config/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /6.4/config/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | network.host: 0.0.0.0 2 | 3 | # this value is required because we set "network.host" 4 | # be sure to modify it appropriately for a production cluster deployment 5 | discovery.zen.minimum_master_nodes: 1 6 | # bootstrap.memory_lock: true 7 | 8 | node.master: true 9 | node.ingest: true 10 | node.data: true 11 | -------------------------------------------------------------------------------- /5.5/config/elastic/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /5.6/config/elastic/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /6.0/config/elastic/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /6.3/config/elastic/log4j2.properties: -------------------------------------------------------------------------------- 1 | status = error 2 | 3 | appender.console.type = Console 4 | appender.console.name = console 5 | appender.console.layout.type = PatternLayout 6 | appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n 7 | 8 | rootLogger.level = info 9 | rootLogger.appenderRef.console.ref = console 10 | -------------------------------------------------------------------------------- /5.5/config/elastic/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | network.host: 0.0.0.0 2 | 3 | # this value is required because we set "network.host" 4 | # be sure to modify it appropriately for a production cluster deployment 5 | discovery.zen.minimum_master_nodes: 1 6 | # bootstrap.memory_lock: true 7 | 8 | node.master: true 9 | node.ingest: true 10 | node.data: true 11 | -------------------------------------------------------------------------------- /5.6/config/elastic/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | network.host: 0.0.0.0 2 | 3 | # this value is required because we set "network.host" 4 | # be sure to modify it appropriately for a production cluster deployment 5 | discovery.zen.minimum_master_nodes: 1 6 | # bootstrap.memory_lock: true 7 | 8 | node.master: true 9 | node.ingest: true 10 | node.data: true 11 | -------------------------------------------------------------------------------- /6.0/config/elastic/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | network.host: 0.0.0.0 2 | 3 | # this value is required because we set "network.host" 4 | # be sure to modify it appropriately for a production cluster deployment 5 | discovery.zen.minimum_master_nodes: 1 6 | # bootstrap.memory_lock: true 7 | 8 | node.master: true 9 | node.ingest: true 10 | node.data: true 11 | -------------------------------------------------------------------------------- /6.3/config/elastic/elasticsearch.yml: -------------------------------------------------------------------------------- 1 | network.host: 0.0.0.0 2 | 3 | # this value is required because we set "network.host" 4 | # be sure to modify it appropriately for a production cluster deployment 5 | discovery.zen.minimum_master_nodes: 1 6 | # bootstrap.memory_lock: true 7 | 8 | node.master: true 9 | node.ingest: true 10 | node.data: true 11 | -------------------------------------------------------------------------------- /7.0/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(cat Dockerfile | grep '^ENV VERSION' | cut -d" " -f3) 6 | TAGS=($VERSION 7) 7 | 8 | for TAG in "${TAGS[@]}"; do 9 | echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:$TAG" 10 | docker tag $IMAGE_NAME $DOCKER_REPO:$TAG 11 | echo "===> Pushing $DOCKER_REPO:$TAG" 12 | docker push $DOCKER_REPO:$TAG 13 | done -------------------------------------------------------------------------------- /6.3/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(cat Dockerfile | grep '^ENV VERSION' | cut -d" " -f3) 6 | TAGS=($VERSION) 7 | 8 | for TAG in "${TAGS[@]}"; do 9 | echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:$TAG" 10 | docker tag $IMAGE_NAME $DOCKER_REPO:$TAG 11 | echo "===> Pushing $DOCKER_REPO:$TAG" 12 | docker push $DOCKER_REPO:$TAG 13 | done 14 | -------------------------------------------------------------------------------- /6.4/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(cat Dockerfile | grep '^ENV VERSION' | cut -d" " -f3) 6 | TAGS=($VERSION) 7 | 8 | for TAG in "${TAGS[@]}"; do 9 | echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:$TAG" 10 | docker tag $IMAGE_NAME $DOCKER_REPO:$TAG 11 | echo "===> Pushing $DOCKER_REPO:$TAG" 12 | docker push $DOCKER_REPO:$TAG 13 | done 14 | -------------------------------------------------------------------------------- /6.5/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(cat Dockerfile | grep '^ENV VERSION' | cut -d" " -f3) 6 | TAGS=($VERSION) 7 | 8 | for TAG in "${TAGS[@]}"; do 9 | echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:$TAG" 10 | docker tag $IMAGE_NAME $DOCKER_REPO:$TAG 11 | echo "===> Pushing $DOCKER_REPO:$TAG" 12 | docker push $DOCKER_REPO:$TAG 13 | done 14 | -------------------------------------------------------------------------------- /6.6/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(cat Dockerfile | grep '^ENV VERSION' | cut -d" " -f3) 6 | TAGS=($VERSION 6) 7 | 8 | for TAG in "${TAGS[@]}"; do 9 | echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:$TAG" 10 | docker tag $IMAGE_NAME $DOCKER_REPO:$TAG 11 | echo "===> Pushing $DOCKER_REPO:$TAG" 12 | docker push $DOCKER_REPO:$TAG 13 | done 14 | -------------------------------------------------------------------------------- /x-pack/hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | VERSION=$(cat Dockerfile | grep '^ENV ELASTICSEARCH_VERSION' | cut -d" " -f3) 6 | TAGS=($VERSION 7) 7 | 8 | for TAG in "${TAGS[@]}"; do 9 | echo "===> Tagging $IMAGE_NAME as $DOCKER_REPO:x-pack-$TAG" 10 | docker tag $IMAGE_NAME $DOCKER_REPO:x-pack-$TAG 11 | echo "===> Pushing $DOCKER_REPO:x-pack-$TAG" 12 | docker push $DOCKER_REPO:x-pack-$TAG 13 | done -------------------------------------------------------------------------------- /hack/make/dockerfile: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | VERSION=$(cat "$BUILD/Dockerfile" | grep '^ENV VERSION' | cut -d" " -f3) 4 | DOWNLOAD_URL="https://artifacts.elastic.co/downloads/elasticsearch" 5 | EXPECTED_SHA_URL=$(cat "$BUILD/Dockerfile" | grep '^ENV EXPECTED_SHA_URL' | cut -d" " -f3) 6 | 7 | echo "===> Getting $BUILD tarball sha1 for version: $VERSION" 8 | SHA_URL=$(eval echo $EXPECTED_SHA_URL) 9 | TARBALL_SHA=$(curl -s "$SHA_URL" | cut -d" " -f1) 10 | 11 | echo " * TARBALL_SHA=$TARBALL_SHA" 12 | sed -i.bu 's/TARBALL_SHA "[0-9a-f.]\{128\}"/TARBALL_SHA "'$TARBALL_SHA'"/' $BUILD/Dockerfile 13 | echo 14 | -------------------------------------------------------------------------------- /6.4/healthcheck: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | host="$(hostname --ip-address || echo '127.0.0.1')" 5 | 6 | if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then 7 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 8 | if [ "$health" = 'green' ]; then 9 | exit 0 10 | fi 11 | echo >&2 "unexpected health status: $health" 12 | fi 13 | 14 | # If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. 15 | # https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck 16 | exit 2 17 | -------------------------------------------------------------------------------- /5.5/docker-healthcheck: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | host="$(hostname --ip-address || echo '127.0.0.1')" 5 | 6 | if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then 7 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 8 | if [ "$health" = 'green' ]; then 9 | exit 0 10 | fi 11 | echo >&2 "unexpected health status: $health" 12 | fi 13 | 14 | # If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. 15 | # https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck 16 | exit 2 17 | -------------------------------------------------------------------------------- /5.6/docker-healthcheck: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | host="$(hostname --ip-address || echo '127.0.0.1')" 5 | 6 | if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then 7 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 8 | if [ "$health" = 'green' ]; then 9 | exit 0 10 | fi 11 | echo >&2 "unexpected health status: $health" 12 | fi 13 | 14 | # If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. 15 | # https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck 16 | exit 2 17 | -------------------------------------------------------------------------------- /6.0/docker-healthcheck: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | host="$(hostname --ip-address || echo '127.0.0.1')" 5 | 6 | if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then 7 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 8 | if [ "$health" = 'green' ]; then 9 | exit 0 10 | fi 11 | echo >&2 "unexpected health status: $health" 12 | fi 13 | 14 | # If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. 15 | # https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck 16 | exit 2 17 | -------------------------------------------------------------------------------- /6.3/docker-healthcheck: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -eo pipefail 3 | 4 | host="$(hostname --ip-address || echo '127.0.0.1')" 5 | 6 | if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then 7 | health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") 8 | if [ "$health" = 'green' ]; then 9 | exit 0 10 | fi 11 | echo >&2 "unexpected health status: $health" 12 | fi 13 | 14 | # If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. 15 | # https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck 16 | exit 2 17 | -------------------------------------------------------------------------------- /6.4/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | umask 0002 6 | 7 | declare -a es_opts 8 | 9 | while IFS='=' read -r envvar_key envvar_value 10 | do 11 | # Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` 12 | if [[ "$envvar_key" =~ ^[a-z0-9_]+\.[a-z0-9_]+ ]]; then 13 | if [[ ! -z $envvar_value ]]; then 14 | es_opt="-E${envvar_key}=${envvar_value}" 15 | es_opts+=("${es_opt}") 16 | fi 17 | fi 18 | done < <(env) 19 | 20 | export ES_JAVA_OPTS="-Des.cgroups.hierarchy.override=/ $ES_JAVA_OPTS" 21 | 22 | # Determine if x-pack is enabled 23 | if bin/elasticsearch-plugin list -s | grep -q x-pack; then 24 | if [[ -n "$ELASTIC_PASSWORD" ]]; then 25 | [[ -f config/elasticsearch.keystore ]] || bin/elasticsearch-keystore create 26 | echo "$ELASTIC_PASSWORD" | bin/elasticsearch-keystore add -x 'bootstrap.password' 27 | fi 28 | fi 29 | 30 | # Add elasticsearch as command if needed 31 | if [ "${1:0:1}" = '-' ]; then 32 | set -- elasticsearch "$@" 33 | fi 34 | 35 | # Drop root privileges if we are running elasticsearch 36 | # allow the container to be started with `--user` 37 | if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then 38 | # Change the ownership of user-mutable directories to elasticsearch 39 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/{data,logs} 40 | 41 | set -- su-exec elasticsearch "$@" "${es_opts[@]}" 42 | fi 43 | 44 | exec "$@" 45 | -------------------------------------------------------------------------------- /6.3/elastic-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | umask 0002 6 | 7 | declare -a es_opts 8 | 9 | while IFS='=' read -r envvar_key envvar_value 10 | do 11 | # Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` 12 | if [[ "$envvar_key" =~ ^[a-z0-9_]+\.[a-z0-9_]+ ]]; then 13 | if [[ ! -z $envvar_value ]]; then 14 | es_opt="-E${envvar_key}=${envvar_value}" 15 | es_opts+=("${es_opt}") 16 | fi 17 | fi 18 | done < <(env) 19 | 20 | export ES_JAVA_OPTS="-Des.cgroups.hierarchy.override=/ $ES_JAVA_OPTS" 21 | 22 | # Determine if x-pack is enabled 23 | if bin/elasticsearch-plugin list -s | grep -q x-pack; then 24 | if [[ -n "$ELASTIC_PASSWORD" ]]; then 25 | [[ -f config/elasticsearch.keystore ]] || bin/elasticsearch-keystore create 26 | echo "$ELASTIC_PASSWORD" | bin/elasticsearch-keystore add -x 'bootstrap.password' 27 | fi 28 | fi 29 | 30 | # Add elasticsearch as command if needed 31 | if [ "${1:0:1}" = '-' ]; then 32 | set -- elasticsearch "$@" 33 | fi 34 | 35 | # Drop root privileges if we are running elasticsearch 36 | # allow the container to be started with `--user` 37 | if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then 38 | # Change the ownership of user-mutable directories to elasticsearch 39 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/{data,logs} 40 | 41 | set -- su-exec elasticsearch "$@" "${es_opts[@]}" 42 | fi 43 | 44 | exec "$@" 45 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: /app 5 | docker: 6 | - image: docker:17.11.0-ce-git 7 | steps: 8 | - checkout 9 | - setup_remote_docker: 10 | version: 17.11.0-ce 11 | - run: 12 | name: Install dependencies 13 | command: | 14 | apk add --no-cache jq 15 | - restore_cache: 16 | keys: 17 | - v1-{{ .Branch }} 18 | paths: 19 | - /caches/app.tar 20 | - run: 21 | name: Load Docker image layer cache 22 | command: | 23 | set +o pipefail 24 | docker load -i /caches/app.tar | true 25 | - run: 26 | name: Build application Docker image 27 | command: | 28 | cd $(cat LATEST) 29 | docker version 30 | docker build --cache-from=app -t app . 31 | - run: 32 | name: Get Docker image size 33 | command: | 34 | mkdir /tmp/artifacts; 35 | docker images --format "{{.Size}}" app > /tmp/artifacts/size; 36 | - store_artifacts: 37 | path: /tmp/artifacts 38 | - run: 39 | name: Save Docker image layer cache 40 | command: | 41 | mkdir -p /caches 42 | docker save -o /caches/app.tar app 43 | - save_cache: 44 | key: v1-{{ .Branch }}-{{ epoch }} 45 | paths: 46 | - /caches/app.tar 47 | - run: 48 | name: Run elasticsearch 49 | command: | 50 | set -x 51 | docker run -d --name es -p 9200:9200 -e cluster.name=testcluster -e discovery.type=single-node app; sleep 20; 52 | docker logs es 53 | - run: 54 | name: Run test 55 | command: | 56 | set -x 57 | docker run --rm --network container:es blacktop/httpie GET http://localhost:9200 58 | -------------------------------------------------------------------------------- /5.5/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.6 2 | 3 | LABEL maintainer "https://github.com/blacktop" 4 | 5 | RUN apk add --no-cache openjdk8-jre su-exec 6 | 7 | ENV ES_VERSION 5.5.2 8 | 9 | ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" 10 | ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz" 11 | ENV ES_TARBALL_ASC "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz.asc" 12 | ENV SHA1_URL "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz.sha1" 13 | ENV ES_TARBALL_SHA1 "91b3b3c823fafce54609ed5c9075d9cf50b2edff" 14 | ENV GPG_KEY "46095ACC8548582C1A2699A9D27D666CD88E42B4" 15 | 16 | RUN apk add --no-cache bash 17 | RUN apk add --no-cache -t .build-deps wget ca-certificates gnupg openssl \ 18 | && cd /tmp \ 19 | && echo "===> Install Elasticsearch..." \ 20 | && EXPECTED_SHA=$(wget -O - ${SHA1_URL}) \ 21 | && wget -O elasticsearch.tar.gz "$ES_TARBAL"; \ 22 | if [ "$ES_TARBALL_SHA1" ]; then \ 23 | echo "$ES_TARBALL_SHA1 *elasticsearch.tar.gz" | sha1sum -c -; \ 24 | fi; \ 25 | if [ "$ES_TARBALL_ASC" ]; then \ 26 | wget -O elasticsearch.tar.gz.asc "$ES_TARBALL_ASC"; \ 27 | export GNUPGHOME="$(mktemp -d)"; \ 28 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \ 29 | gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ 30 | rm -r "$GNUPGHOME" elasticsearch.tar.gz.asc; \ 31 | fi; \ 32 | tar -xf elasticsearch.tar.gz \ 33 | && ls -lah \ 34 | && mv elasticsearch-$ES_VERSION /usr/share/elasticsearch \ 35 | && adduser -D -h /usr/share/elasticsearch elasticsearch \ 36 | && echo "===> Creating Elasticsearch Paths..." \ 37 | && for path in \ 38 | /usr/share/elasticsearch/data \ 39 | /usr/share/elasticsearch/logs \ 40 | /usr/share/elasticsearch/config \ 41 | /usr/share/elasticsearch/config/scripts \ 42 | /usr/share/elasticsearch/plugins \ 43 | ; do \ 44 | mkdir -p "$path"; \ 45 | chown -R elasticsearch:elasticsearch "$path"; \ 46 | done \ 47 | && rm -rf /tmp/* \ 48 | && apk del --purge .build-deps 49 | 50 | COPY config/elastic /usr/share/elasticsearch/config 51 | COPY config/logrotate /etc/logrotate.d/elasticsearch 52 | COPY elastic-entrypoint.sh / 53 | COPY docker-healthcheck /usr/local/bin/ 54 | 55 | WORKDIR /usr/share/elasticsearch 56 | 57 | ENV PATH /usr/share/elasticsearch/bin:$PATH 58 | 59 | VOLUME ["/usr/share/elasticsearch/data"] 60 | 61 | EXPOSE 9200 9300 62 | ENTRYPOINT ["/elastic-entrypoint.sh"] 63 | CMD ["elasticsearch"] 64 | 65 | # HEALTHCHECK CMD ["docker-healthcheck"] 66 | -------------------------------------------------------------------------------- /5.6/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.8 2 | 3 | LABEL maintainer "https://github.com/blacktop" 4 | 5 | RUN apk add --no-cache openjdk8-jre su-exec 6 | 7 | ENV ES_VERSION 5.6.15 8 | 9 | ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" 10 | ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz" 11 | ENV ES_TARBALL_ASC "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz.asc" 12 | ENV SHA1_URL "${DOWNLOAD_URL}/elasticsearch-${ES_VERSION}.tar.gz.sha1" 13 | ENV ES_TARBALL_SHA1 "15a79ff7206aea581f6afae48c4637210f5b3539" 14 | ENV GPG_KEY "46095ACC8548582C1A2699A9D27D666CD88E42B4" 15 | 16 | RUN apk add --no-cache bash 17 | RUN apk add --no-cache -t .build-deps wget ca-certificates gnupg openssl \ 18 | && cd /tmp \ 19 | && echo "===> Install Elasticsearch..." \ 20 | && EXPECTED_SHA=$(wget -O - ${SHA1_URL}) \ 21 | && wget --progress=bar:force -O elasticsearch.tar.gz "$ES_TARBAL"; \ 22 | if [ "$ES_TARBALL_SHA1" ]; then \ 23 | echo "$ES_TARBALL_SHA1 *elasticsearch.tar.gz" | sha1sum -c -; \ 24 | fi; \ 25 | if [ "$ES_TARBALL_ASC" ]; then \ 26 | wget --progress=bar:force -O elasticsearch.tar.gz.asc "$ES_TARBALL_ASC"; \ 27 | export GNUPGHOME="$(mktemp -d)"; \ 28 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \ 29 | gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ 30 | rm -r "$GNUPGHOME" elasticsearch.tar.gz.asc; \ 31 | fi; \ 32 | tar -xf elasticsearch.tar.gz \ 33 | && ls -lah \ 34 | && mv elasticsearch-$ES_VERSION /usr/share/elasticsearch \ 35 | && adduser -D -h /usr/share/elasticsearch elasticsearch \ 36 | && echo "===> Creating Elasticsearch Paths..." \ 37 | && for path in \ 38 | /usr/share/elasticsearch/data \ 39 | /usr/share/elasticsearch/logs \ 40 | /usr/share/elasticsearch/config \ 41 | /usr/share/elasticsearch/config/scripts \ 42 | /usr/share/elasticsearch/plugins \ 43 | ; do \ 44 | mkdir -p "$path"; \ 45 | chown -R elasticsearch:elasticsearch "$path"; \ 46 | done \ 47 | && rm -rf /tmp/* \ 48 | && apk del --purge .build-deps 49 | 50 | COPY config/elastic /usr/share/elasticsearch/config 51 | COPY config/logrotate /etc/logrotate.d/elasticsearch 52 | COPY elastic-entrypoint.sh / 53 | COPY docker-healthcheck /usr/local/bin/ 54 | 55 | WORKDIR /usr/share/elasticsearch 56 | 57 | ENV PATH /usr/share/elasticsearch/bin:$PATH 58 | 59 | VOLUME ["/usr/share/elasticsearch/data"] 60 | 61 | EXPOSE 9200 9300 62 | ENTRYPOINT ["/elastic-entrypoint.sh"] 63 | CMD ["elasticsearch"] 64 | 65 | # HEALTHCHECK CMD ["docker-healthcheck"] 66 | -------------------------------------------------------------------------------- /6.0/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.6 2 | 3 | LABEL maintainer "https://github.com/blacktop" 4 | 5 | RUN apk add --no-cache openjdk8-jre su-exec 6 | 7 | ENV VERSION 6.0.0 8 | 9 | ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" 10 | ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-${VERSION}.tar.gz" 11 | ENV ES_TARBALL_ASC "${DOWNLOAD_URL}/elasticsearch-${VERSION}.tar.gz.asc" 12 | ENV EXPECTED_SHA_URL "${DOWNLOAD_URL}/elasticsearch-${VERSION}.tar.gz.sha512" 13 | ENV ES_TARBALL_SHA "ec0ab309aa878ffd3b7f00388b2a837f971ff479395928cd52eac7fb8d27056bc487d1b440fcb9e27c12aa681ec7b39d7254162c617e5f81b8a9ca5b1d5ff3e5 elasticsearch-6.0.0-rc2.tar.gz" 14 | ENV GPG_KEY "46095ACC8548582C1A2699A9D27D666CD88E42B4" 15 | 16 | RUN apk add --no-cache bash 17 | RUN apk add --no-cache -t .build-deps wget ca-certificates gnupg openssl \ 18 | && cd /tmp \ 19 | && echo "===> Install Elasticsearch..." \ 20 | && wget --progress=bar:force -O elasticsearch.tar.gz "$ES_TARBAL"; \ 21 | if [ "$ES_TARBALL_SHA" ]; then \ 22 | echo "$ES_TARBALL_SHA *elasticsearch.tar.gz" | sha512sum -c -; \ 23 | fi; \ 24 | if [ "$ES_TARBALL_ASC" ]; then \ 25 | wget --progress=bar:force -O elasticsearch.tar.gz.asc "$ES_TARBALL_ASC"; \ 26 | export GNUPGHOME="$(mktemp -d)"; \ 27 | gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \ 28 | gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ 29 | rm -r "$GNUPGHOME" elasticsearch.tar.gz.asc; \ 30 | fi; \ 31 | tar -xf elasticsearch.tar.gz \ 32 | && ls -lah \ 33 | && mv elasticsearch-$VERSION /usr/share/elasticsearch \ 34 | && adduser -D -h /usr/share/elasticsearch elasticsearch \ 35 | && echo "===> Creating Elasticsearch Paths..." \ 36 | && for path in \ 37 | /usr/share/elasticsearch/data \ 38 | /usr/share/elasticsearch/logs \ 39 | /usr/share/elasticsearch/config \ 40 | /usr/share/elasticsearch/config/scripts \ 41 | /usr/share/elasticsearch/plugins \ 42 | ; do \ 43 | mkdir -p "$path"; \ 44 | chown -R elasticsearch:elasticsearch "$path"; \ 45 | done \ 46 | && rm -rf /tmp/* \ 47 | && apk del --purge .build-deps 48 | 49 | COPY config/elastic /usr/share/elasticsearch/config 50 | COPY config/logrotate /etc/logrotate.d/elasticsearch 51 | COPY elastic-entrypoint.sh / 52 | COPY docker-healthcheck /usr/local/bin/ 53 | 54 | WORKDIR /usr/share/elasticsearch 55 | 56 | ENV PATH /usr/share/elasticsearch/bin:$PATH 57 | 58 | VOLUME ["/usr/share/elasticsearch/data"] 59 | 60 | EXPOSE 9200 9300 61 | ENTRYPOINT ["/elastic-entrypoint.sh"] 62 | CMD ["elasticsearch"] 63 | 64 | # HEALTHCHECK CMD ["docker-healthcheck"] 65 | -------------------------------------------------------------------------------- /6.3/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.8 2 | 3 | LABEL maintainer "https://github.com/blacktop" 4 | 5 | RUN apk add --no-cache openjdk8-jre su-exec 6 | 7 | ENV VERSION 6.3.2 8 | ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" 9 | ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}.tar.gz" 10 | ENV ES_TARBALL_ASC "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}.tar.gz.asc" 11 | ENV EXPECTED_SHA_URL "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}.tar.gz.sha512" 12 | ENV ES_TARBALL_SHA "3c51a860414f7e55900b1d9a350bdbc3e673c8445e316454c2480315b4b9fc08df58090c6281cecc3ae63d12d78d6bd58e228b3371aa325db799ce18758a21f4" 13 | ENV GPG_KEY "46095ACC8548582C1A2699A9D27D666CD88E42B4" 14 | # https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-6.3.0.zip 15 | RUN apk add --no-cache bash 16 | RUN apk add --no-cache -t .build-deps wget ca-certificates gnupg openssl \ 17 | && set -ex \ 18 | && cd /tmp \ 19 | && echo "===> Install Elasticsearch..." \ 20 | && wget --progress=bar:force -O elasticsearch.tar.gz "$ES_TARBAL"; \ 21 | if [ "$ES_TARBALL_SHA" ]; then \ 22 | echo "$ES_TARBALL_SHA *elasticsearch.tar.gz" | sha512sum -c -; \ 23 | fi; \ 24 | if [ "$ES_TARBALL_ASC" ]; then \ 25 | wget --progress=bar:force -O elasticsearch.tar.gz.asc "$ES_TARBALL_ASC"; \ 26 | export GNUPGHOME="$(mktemp -d)"; \ 27 | ( gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ 28 | || gpg --keyserver pgp.mit.edu --recv-keys "$GPG_KEY" \ 29 | || gpg --keyserver keyserver.pgp.com --recv-keys "$GPG_KEY" ); \ 30 | gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ 31 | rm -rf "$GNUPGHOME" elasticsearch.tar.gz.asc || true; \ 32 | fi; \ 33 | tar -xf elasticsearch.tar.gz \ 34 | && ls -lah \ 35 | && mv elasticsearch-$VERSION /usr/share/elasticsearch \ 36 | && adduser -D -h /usr/share/elasticsearch elasticsearch \ 37 | && echo "===> Creating Elasticsearch Paths..." \ 38 | && for path in \ 39 | /usr/share/elasticsearch/data \ 40 | /usr/share/elasticsearch/logs \ 41 | /usr/share/elasticsearch/config \ 42 | /usr/share/elasticsearch/config/scripts \ 43 | /usr/share/elasticsearch/tmp \ 44 | /usr/share/elasticsearch/plugins \ 45 | ; do \ 46 | mkdir -p "$path"; \ 47 | chown -R elasticsearch:elasticsearch "$path"; \ 48 | done \ 49 | && rm -rf /tmp/* \ 50 | && apk del --purge .build-deps 51 | 52 | COPY config/elastic /usr/share/elasticsearch/config 53 | COPY config/logrotate /etc/logrotate.d/elasticsearch 54 | COPY elastic-entrypoint.sh / 55 | COPY docker-healthcheck /usr/local/bin/ 56 | 57 | WORKDIR /usr/share/elasticsearch 58 | 59 | ENV PATH /usr/share/elasticsearch/bin:$PATH 60 | ENV ES_TMPDIR /usr/share/elasticsearch/tmp 61 | 62 | VOLUME ["/usr/share/elasticsearch/data"] 63 | 64 | EXPOSE 9200 9300 65 | ENTRYPOINT ["/elastic-entrypoint.sh"] 66 | CMD ["elasticsearch"] 67 | 68 | # HEALTHCHECK CMD ["docker-healthcheck"] 69 | -------------------------------------------------------------------------------- /6.4/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.8 2 | 3 | LABEL maintainer "https://github.com/blacktop" 4 | 5 | RUN apk add --no-cache openjdk8-jre su-exec 6 | 7 | ENV VERSION 6.4.0 8 | ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" 9 | ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}.tar.gz" 10 | ENV ES_TARBALL_ASC "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}.tar.gz.asc" 11 | ENV EXPECTED_SHA_URL "${DOWNLOAD_URL}/elasticsearch-oss-${VERSION}.tar.gz.sha512" 12 | ENV ES_TARBALL_SHA "6f465378a51c487f1f6a84a0843ac1038db60170ee8a5d96874a759f6dbbf2de9f7bcbbf55616f49f28f1098c82f2e585c917267d02b8b1f43627a1984b3da66" 13 | ENV GPG_KEY "46095ACC8548582C1A2699A9D27D666CD88E42B4" 14 | 15 | RUN apk add --no-cache bash 16 | RUN apk add --no-cache -t .build-deps wget ca-certificates gnupg openssl \ 17 | && set -ex \ 18 | && cd /tmp \ 19 | && echo "===> Install Elasticsearch..." \ 20 | && wget --progress=bar:force -O elasticsearch.tar.gz "$ES_TARBAL"; \ 21 | if [ "$ES_TARBALL_SHA" ]; then \ 22 | echo "$ES_TARBALL_SHA *elasticsearch.tar.gz" | sha512sum -c -; \ 23 | fi; \ 24 | if [ "$ES_TARBALL_ASC" ]; then \ 25 | wget --progress=bar:force -O elasticsearch.tar.gz.asc "$ES_TARBALL_ASC"; \ 26 | export GNUPGHOME="$(mktemp -d)"; \ 27 | ( gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY" \ 28 | || gpg --keyserver pgp.mit.edu --recv-keys "$GPG_KEY" \ 29 | || gpg --keyserver keyserver.pgp.com --recv-keys "$GPG_KEY" ); \ 30 | gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ 31 | rm -rf "$GNUPGHOME" elasticsearch.tar.gz.asc || true; \ 32 | fi; \ 33 | tar -xf elasticsearch.tar.gz \ 34 | && ls -lah \ 35 | && mv elasticsearch-$VERSION /usr/share/elasticsearch \ 36 | && adduser -D -h /usr/share/elasticsearch elasticsearch \ 37 | && echo "===> Creating Elasticsearch Paths..." \ 38 | && for path in \ 39 | /usr/share/elasticsearch/data \ 40 | /usr/share/elasticsearch/logs \ 41 | /usr/share/elasticsearch/config \ 42 | /usr/share/elasticsearch/config/scripts \ 43 | /usr/share/elasticsearch/tmp \ 44 | /usr/share/elasticsearch/plugins \ 45 | ; do \ 46 | mkdir -p "$path"; \ 47 | chown -R elasticsearch:elasticsearch "$path"; \ 48 | done \ 49 | && rm -rf /tmp/* \ 50 | && apk del --purge .build-deps 51 | 52 | COPY config/elasticsearch.yml /usr/share/elasticsearch/config/elasticsearch.yml 53 | COPY config/log4j2.properties /usr/share/elasticsearch/config/log4j2.properties 54 | COPY config/logrotate /etc/logrotate.d/elasticsearch 55 | COPY entrypoint.sh / 56 | COPY healthcheck /usr/local/bin/ 57 | 58 | WORKDIR /usr/share/elasticsearch 59 | 60 | ENV PATH /usr/share/elasticsearch/bin:$PATH 61 | ENV ES_TMPDIR /usr/share/elasticsearch/tmp 62 | 63 | VOLUME ["/usr/share/elasticsearch/data"] 64 | 65 | EXPOSE 9200 9300 66 | ENTRYPOINT ["/entrypoint.sh"] 67 | CMD ["elasticsearch"] 68 | 69 | # HEALTHCHECK CMD ["docker-healthcheck"] 70 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![es-logo](https://raw.githubusercontent.com/maliceio/elasticsearch/master/es-logo.png) 2 | 3 | # malice-elasticsearch 4 | 5 | [![CircleCI](https://circleci.com/gh/maliceio/elasticsearch.png?style=shield)](https://circleci.com/gh/maliceio/elasticsearch) [![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org) [![Docker Stars](https://img.shields.io/docker/stars/malice/elasticsearch.svg)](https://hub.docker.com/r/malice/elasticsearch/) [![Docker Pulls](https://img.shields.io/docker/pulls/malice/elasticsearch.svg)](https://hub.docker.com/r/malice/elasticsearch/) [![Docker Image](https://img.shields.io/badge/docker%20image-126MB-blue.svg)](https://hub.docker.com/r/malice/elasticsearch/) 6 | 7 | Malice's Custom [Elasticsearch](https://www.elastic.co/products/elasticsearch) Docker Image 8 | 9 | **Table of Contents** 10 | 11 | - [Dependencies](#dependencies) 12 | - [Image Tags](#image-tags) 13 | - [Getting Started](#getting-started) 14 | - [Documentation](#documentation) 15 | - [Issues](#issues) 16 | - [Credits](#credits) 17 | - [CHANGELOG](#changelog) 18 | - [Contributing](#contributing) 19 | - [License](#license) 20 | 21 | ### Dependencies 22 | 23 | - [alpine:3.8](https://index.docker.io/_/gliderlabs/alpine/) 24 | 25 | ### Image Tags 26 | 27 | ```bash 28 | REPOSITORY TAG SIZE 29 | malice/elasticsearch latest 126MB 30 | malice/elasticsearch 7.0 126MB 31 | malice/elasticsearch 6.6 126MB 32 | malice/elasticsearch 6.4 127MB 33 | malice/elasticsearch 6.3 122MB 34 | malice/elasticsearch 6.0 117MB 35 | malice/elasticsearch 5.6 124MB 36 | malice/elasticsearch 5.5 123MB 37 | ``` 38 | 39 | ### Getting Started 40 | 41 | ```bash 42 | $ docker run -d --name elastic -p 9200:9200 malice/elasticsearch 43 | ``` 44 | 45 | ### Documentation 46 | 47 | ### Known Issues :warning: 48 | 49 | I have noticed when running the new **5.0+** version on a linux host you need to increase the memory map areas with the following command 50 | 51 | ```bash 52 | sudo sysctl -w vm.max_map_count=262144 53 | ``` 54 | 55 | ### Issues 56 | 57 | Find a bug? Want more features? Find something missing in the documentation? Let me know! Please don't hesitate to [file an issue](https://github.com/maliceio/elasticsearch/issues/new) 58 | 59 | ### Credits 60 | 61 | Heavily (if not entirely) influenced by https://github.com/docker-library/elasticsearch 62 | Production docs from https://stefanprodan.com/2016/elasticsearch-cluster-with-docker/ 63 | 64 | ### CHANGELOG 65 | 66 | See [`CHANGELOG.md`](https://github.com/maliceio/elasticsearch/blob/master/CHANGELOG.md) 67 | 68 | ### Contributing 69 | 70 | [See all contributors on GitHub](https://github.com/maliceio/elasticsearch/graphs/contributors). 71 | 72 | Please update the [CHANGELOG.md](https://github.com/maliceio/elasticsearch/blob/master/CHANGELOG.md) and submit a [Pull Request on GitHub](https://help.github.com/articles/using-pull-requests/). 73 | 74 | ### License 75 | 76 | MIT Copyright (c) 2016-2018 **blacktop** 77 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | REPO=maliceio/elasticsearch 2 | ORG=malice 3 | NAME=elasticsearch 4 | # build info 5 | LATEST ?=$(shell cat LATEST) 6 | BUILD ?=$(LATEST) 7 | BUILDS=$(LATEST) 6.5 5.6 8 | 9 | all: update build size test 10 | 11 | .PHONY: update 12 | update: 13 | $(foreach build,$(BUILDS),NAME=$(NAME) BUILD=$(build) $(MAKE) dockerfile;) 14 | 15 | .PHONY: dockerfile 16 | dockerfile: ## Update Dockerfiles 17 | ifneq "$(BUILD)" "x-pack" 18 | hack/make/dockerfile 19 | endif 20 | 21 | .PHONY: build 22 | build: ## Build docker image 23 | cd $(BUILD); docker build -t $(ORG)/$(NAME):$(BUILD) . 24 | 25 | .PHONY: size 26 | size: build ## Get built image size 27 | ifeq "$(BUILD)" "$(LATEST)" 28 | sed -i.bu 's/docker%20image-.*-blue/docker%20image-$(shell docker images --format "{{.Size}}" $(ORG)/$(NAME):$(BUILD)| cut -d' ' -f1)-blue/' README.md 29 | sed -i.bu '/latest/ s/[0-9.]\{3,5\}MB/$(shell docker images --format "{{.Size}}" $(ORG)/$(NAME):$(BUILD))/' README.md 30 | endif 31 | sed -i.bu '/$(BUILD)/ s/[0-9.]\{3,5\}MB/$(shell docker images --format "{{.Size}}" $(ORG)/$(NAME):$(BUILD))/' README.md 32 | 33 | .PHONY: tag 34 | tag: 35 | ORG=$(ORG) NAME=$(NAME) BUILD=$(BUILD) hack/make/tag 36 | 37 | .PHONY: tags 38 | tags: 39 | docker images --format "table {{.Repository}}\t{{.Tag}}\t{{.Size}}" $(ORG)/$(NAME) 40 | 41 | .PHONY: test 42 | test: stop ## Test docker image 43 | docker run -d --name $(NAME) -e cluster.name=testcluster $(ORG)/$(NAME):$(BUILD); sleep 20; 44 | docker logs $(NAME) 45 | @docker run -it --rm --link $(NAME) --entrypoint=sh blacktop/httpie -c "http elasticsearch:9200 | jq .cluster_name" 46 | docker rm -f $(NAME) 47 | 48 | .PHONY: tar 49 | tar: ## Export tar of docker image 50 | docker save $(ORG)/$(NAME):$(BUILD) -o $(NAME).tar 51 | 52 | .PHONY: push 53 | push: build ## Push docker image to docker registry 54 | @echo "===> Pushing $(ORG)/$(NAME):$(BUILD) to docker hub..." 55 | @docker push $(ORG)/$(NAME):$(BUILD) 56 | 57 | .PHONY: run 58 | run: stop ## Run docker container 59 | @docker run --init -it --rm --name $(NAME) -p 9200:9200 $(ORG)/$(NAME):$(BUILD) 60 | 61 | .PHONY: ssh 62 | ssh: ## SSH into docker image 63 | @docker run --init -it --rm --entrypoint=bash $(ORG)/$(NAME):$(BUILD) 64 | 65 | .PHONY: stop 66 | stop: ## Kill running docker containers 67 | @docker rm -f $(NAME) || true 68 | 69 | .PHONY: circle 70 | circle: ci-size ## Get docker image size from CircleCI 71 | @sed -i.bu 's/docker%20image-.*-blue/docker%20image-$(shell cat .circleci/SIZE)-blue/' README.md 72 | @echo "===> Image size is: $(shell cat .circleci/SIZE)" 73 | 74 | ci-build: 75 | @echo "===> Getting CircleCI build number" 76 | @http https://circleci.com/api/v1.1/project/github/${REPO} | jq '.[0].build_num' > .circleci/build_num 77 | 78 | ci-size: ci-build 79 | @echo "===> Getting image build size from CircleCI" 80 | @http "$(shell http https://circleci.com/api/v1.1/project/github/${REPO}/$(shell cat .circleci/build_num)/artifacts circle-token==${CIRCLE_TOKEN} | jq '.[].url')" > .circleci/SIZE 81 | 82 | .PHONY: clean 83 | clean: ## Clean docker image and stop all running containers 84 | docker-clean stop 85 | docker rmi $(ORG)/$(NAME):$(BUILD) || true 86 | 87 | # Absolutely awesome: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html 88 | help: 89 | @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' 90 | 91 | .DEFAULT_GOAL := help 92 | -------------------------------------------------------------------------------- /5.5/elastic-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | es_opts='' 6 | 7 | while IFS='=' read -r envvar_key envvar_value 8 | do 9 | # Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` 10 | if [[ "$envvar_key" =~ ^[a-z]+\.[a-z]+ ]] 11 | then 12 | if [[ ! -z $envvar_value ]]; then 13 | es_opt="-E${envvar_key}=${envvar_value}" 14 | es_opts+=" ${es_opt}" 15 | fi 16 | fi 17 | done < <(env) 18 | 19 | export ES_JAVA_OPTS="-Des.cgroups.hierarchy.override=/ $ES_JAVA_OPTS" 20 | 21 | # Add elasticsearch as command if needed 22 | if [ "${1:0:1}" = '-' ]; then 23 | set -- elasticsearch "$@" ${es_opts} 24 | fi 25 | 26 | ################################################ 27 | # = MASTER NODE = # 28 | ################################################ 29 | if [ "$1" = 'master' ] && [ "$(id -u)" = '0' ]; then 30 | # Change node into a data node 31 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 32 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'true'!" $CONFIG 33 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'false'!" $CONFIG 34 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'false'!" $CONFIG 35 | 36 | # Change the ownership of user-mutable directories to elasticsearch 37 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 38 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 39 | 40 | set -- su-exec elasticsearch "$@" ${es_opts} 41 | fi 42 | 43 | ################################################ 44 | # = INGEST NODE = # 45 | ################################################ 46 | if [ "$1" = 'ingest' ] && [ "$(id -u)" = '0' ]; then 47 | # Change node into a data node 48 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 49 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'false'!" $CONFIG 50 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'true'!" $CONFIG 51 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'false'!" $CONFIG 52 | # Set master.node's name 53 | if ! grep -q "discovery.zen.ping.unicast.hosts" $CONFIG; then 54 | echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> $CONFIG 55 | fi 56 | 57 | # Change the ownership of user-mutable directories to elasticsearch 58 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 59 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 60 | 61 | set -- su-exec elasticsearch "$@" ${es_opts} 62 | fi 63 | 64 | ################################################ 65 | # = DATA NODE = # 66 | ################################################ 67 | if [ "$1" = 'data' ] && [ "$(id -u)" = '0' ]; then 68 | # Change node into a data node 69 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 70 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'false'!" $CONFIG 71 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'false'!" $CONFIG 72 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'true'!" $CONFIG 73 | # Set master.node's name 74 | if ! grep -q "discovery.zen.ping.unicast.hosts" $CONFIG; then 75 | echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> $CONFIG 76 | fi 77 | 78 | # Change the ownership of user-mutable directories to elasticsearch 79 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 80 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 81 | 82 | set -- su-exec elasticsearch "$@" ${es_opts} 83 | 84 | fi 85 | 86 | # Drop root privileges if we are running elasticsearch 87 | # allow the container to be started with `--user` 88 | if [ "$1" = 'elasticsearch' ] && [ "$(id -u)" = '0' ]; then 89 | # Change the ownership of user-mutable directories to elasticsearch 90 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 91 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 92 | 93 | set -- su-exec elasticsearch "$@" ${es_opts} 94 | fi 95 | 96 | exec "$@" 97 | -------------------------------------------------------------------------------- /5.6/elastic-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | es_opts='' 6 | 7 | while IFS='=' read -r envvar_key envvar_value 8 | do 9 | # Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` 10 | if [[ "$envvar_key" =~ ^[a-z]+\.[a-z]+ ]] 11 | then 12 | if [[ ! -z $envvar_value ]]; then 13 | es_opt="-E${envvar_key}=${envvar_value}" 14 | es_opts+=" ${es_opt}" 15 | fi 16 | fi 17 | done < <(env) 18 | 19 | export ES_JAVA_OPTS="-Des.cgroups.hierarchy.override=/ $ES_JAVA_OPTS" 20 | 21 | # Add elasticsearch as command if needed 22 | if [ "${1:0:1}" = '-' ]; then 23 | set -- elasticsearch "$@" ${es_opts} 24 | fi 25 | 26 | ################################################ 27 | # = MASTER NODE = # 28 | ################################################ 29 | if [ "$1" = 'master' ] && [ "$(id -u)" = '0' ]; then 30 | # Change node into a data node 31 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 32 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'true'!" $CONFIG 33 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'false'!" $CONFIG 34 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'false'!" $CONFIG 35 | 36 | # Change the ownership of user-mutable directories to elasticsearch 37 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 38 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 39 | 40 | set -- su-exec elasticsearch "$@" ${es_opts} 41 | fi 42 | 43 | ################################################ 44 | # = INGEST NODE = # 45 | ################################################ 46 | if [ "$1" = 'ingest' ] && [ "$(id -u)" = '0' ]; then 47 | # Change node into a data node 48 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 49 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'false'!" $CONFIG 50 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'true'!" $CONFIG 51 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'false'!" $CONFIG 52 | # Set master.node's name 53 | if ! grep -q "discovery.zen.ping.unicast.hosts" $CONFIG; then 54 | echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> $CONFIG 55 | fi 56 | 57 | # Change the ownership of user-mutable directories to elasticsearch 58 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 59 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 60 | 61 | set -- su-exec elasticsearch "$@" ${es_opts} 62 | fi 63 | 64 | ################################################ 65 | # = DATA NODE = # 66 | ################################################ 67 | if [ "$1" = 'data' ] && [ "$(id -u)" = '0' ]; then 68 | # Change node into a data node 69 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 70 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'false'!" $CONFIG 71 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'false'!" $CONFIG 72 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'true'!" $CONFIG 73 | # Set master.node's name 74 | if ! grep -q "discovery.zen.ping.unicast.hosts" $CONFIG; then 75 | echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> $CONFIG 76 | fi 77 | 78 | # Change the ownership of user-mutable directories to elasticsearch 79 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 80 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 81 | 82 | set -- su-exec elasticsearch "$@" ${es_opts} 83 | 84 | fi 85 | 86 | # Drop root privileges if we are running elasticsearch 87 | # allow the container to be started with `--user` 88 | if [ "$1" = 'elasticsearch' ] && [ "$(id -u)" = '0' ]; then 89 | # Change the ownership of user-mutable directories to elasticsearch 90 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 91 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 92 | 93 | set -- su-exec elasticsearch "$@" ${es_opts} 94 | fi 95 | 96 | exec "$@" 97 | -------------------------------------------------------------------------------- /6.0/elastic-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | es_opts='' 6 | 7 | while IFS='=' read -r envvar_key envvar_value 8 | do 9 | # Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` 10 | if [[ "$envvar_key" =~ ^[a-z]+\.[a-z]+ ]] 11 | then 12 | if [[ ! -z $envvar_value ]]; then 13 | es_opt="-E${envvar_key}=${envvar_value}" 14 | es_opts+=" ${es_opt}" 15 | fi 16 | fi 17 | done < <(env) 18 | 19 | export ES_JAVA_OPTS="-Des.cgroups.hierarchy.override=/ $ES_JAVA_OPTS" 20 | 21 | # Add elasticsearch as command if needed 22 | if [ "${1:0:1}" = '-' ]; then 23 | set -- elasticsearch "$@" ${es_opts} 24 | fi 25 | 26 | ################################################ 27 | # = MASTER NODE = # 28 | ################################################ 29 | if [ "$1" = 'master' ] && [ "$(id -u)" = '0' ]; then 30 | # Change node into a data node 31 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 32 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'true'!" $CONFIG 33 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'false'!" $CONFIG 34 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'false'!" $CONFIG 35 | 36 | # Change the ownership of user-mutable directories to elasticsearch 37 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 38 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 39 | 40 | set -- su-exec elasticsearch "$@" ${es_opts} 41 | fi 42 | 43 | ################################################ 44 | # = INGEST NODE = # 45 | ################################################ 46 | if [ "$1" = 'ingest' ] && [ "$(id -u)" = '0' ]; then 47 | # Change node into a data node 48 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 49 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'false'!" $CONFIG 50 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'true'!" $CONFIG 51 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'false'!" $CONFIG 52 | # Set master.node's name 53 | if ! grep -q "discovery.zen.ping.unicast.hosts" $CONFIG; then 54 | echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> $CONFIG 55 | fi 56 | 57 | # Change the ownership of user-mutable directories to elasticsearch 58 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 59 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 60 | 61 | set -- su-exec elasticsearch "$@" ${es_opts} 62 | fi 63 | 64 | ################################################ 65 | # = DATA NODE = # 66 | ################################################ 67 | if [ "$1" = 'data' ] && [ "$(id -u)" = '0' ]; then 68 | # Change node into a data node 69 | CONFIG=/usr/share/elasticsearch/config/elasticsearch.yml 70 | sed -ri "s!^(\#\s*)?(node\.master:).*!\2 'false'!" $CONFIG 71 | sed -ri "s!^(\#\s*)?(node\.ingest:).*!\2 'false'!" $CONFIG 72 | sed -ri "s!^(\#\s*)?(node\.data:).*!\2 'true'!" $CONFIG 73 | # Set master.node's name 74 | if ! grep -q "discovery.zen.ping.unicast.hosts" $CONFIG; then 75 | echo "discovery.zen.ping.unicast.hosts: [\"elastic-master\"]" >> $CONFIG 76 | fi 77 | 78 | # Change the ownership of user-mutable directories to elasticsearch 79 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 80 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 81 | 82 | set -- su-exec elasticsearch "$@" ${es_opts} 83 | 84 | fi 85 | 86 | # Drop root privileges if we are running elasticsearch 87 | # allow the container to be started with `--user` 88 | if [ "$1" = 'elasticsearch' ] && [ "$(id -u)" = '0' ]; then 89 | # Change the ownership of user-mutable directories to elasticsearch 90 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data 91 | chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/logs 92 | 93 | set -- su-exec elasticsearch "$@" ${es_opts} 94 | fi 95 | 96 | exec "$@" 97 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright 2016-2018 blacktop 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------