-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #149 from infosiftr/alpine
Add alpine variant
- Loading branch information
Showing
19 changed files
with
494 additions
and
21 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
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
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,76 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
# ensure elasticsearch user exists | ||
RUN addgroup -S elasticsearch && adduser -S -G elasticsearch elasticsearch | ||
|
||
# grab su-exec for easy step-down from root | ||
# and bash for "bin/elasticsearch" among others | ||
RUN apk add --no-cache 'su-exec>=0.2' bash | ||
|
||
# https://artifacts.elastic.co/GPG-KEY-elasticsearch | ||
ENV GPG_KEY 46095ACC8548582C1A2699A9D27D666CD88E42B4 | ||
|
||
WORKDIR /usr/share/elasticsearch | ||
ENV PATH /usr/share/elasticsearch/bin:$PATH | ||
|
||
ENV ELASTICSEARCH_VERSION 1.7.6 | ||
ENV ELASTICSEARCH_TARBALL="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.6.tar.gz" \ | ||
ELASTICSEARCH_TARBALL_ASC="" \ | ||
ELASTICSEARCH_TARBALL_SHA1="0b6ec9fe34b29e6adc4d8481630bf1f69cb04aa9" | ||
|
||
RUN set -ex; \ | ||
\ | ||
apk add --no-cache --virtual .fetch-deps \ | ||
ca-certificates \ | ||
gnupg \ | ||
openssl \ | ||
tar \ | ||
; \ | ||
\ | ||
wget -O elasticsearch.tar.gz "$ELASTICSEARCH_TARBALL"; \ | ||
\ | ||
if [ "$ELASTICSEARCH_TARBALL_SHA1" ]; then \ | ||
echo "$ELASTICSEARCH_TARBALL_SHA1 *elasticsearch.tar.gz" | sha1sum -c -; \ | ||
fi; \ | ||
\ | ||
if [ "$ELASTICSEARCH_TARBALL_ASC" ]; then \ | ||
wget -O elasticsearch.tar.gz.asc "$ELASTICSEARCH_TARBALL_ASC"; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \ | ||
gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ | ||
rm -r "$GNUPGHOME" elasticsearch.tar.gz.asc; \ | ||
fi; \ | ||
\ | ||
tar -xf elasticsearch.tar.gz --strip-components=1; \ | ||
rm elasticsearch.tar.gz; \ | ||
\ | ||
apk del .fetch-deps; \ | ||
\ | ||
mkdir -p ./plugins; \ | ||
for path in \ | ||
./data \ | ||
./logs \ | ||
./config \ | ||
./config/scripts \ | ||
; do \ | ||
mkdir -p "$path"; \ | ||
chown -R elasticsearch:elasticsearch "$path"; \ | ||
done; \ | ||
\ | ||
if [ "${ELASTICSEARCH_VERSION%%.*}" -gt 1 ]; then \ | ||
elasticsearch --version; \ | ||
else \ | ||
# elasticsearch 1.x doesn't support --version | ||
# but in 5.x, "-v" is verbose (and "-V" is --version) | ||
elasticsearch -v; \ | ||
fi | ||
|
||
COPY config ./config | ||
|
||
VOLUME /usr/share/elasticsearch/data | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
EXPOSE 9200 9300 | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["elasticsearch"] |
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,15 @@ | ||
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG | ||
es.logger.level: INFO | ||
rootLogger: ${es.logger.level}, console | ||
logger: | ||
# log action execution errors for easier debugging | ||
action: DEBUG | ||
# reduce the logging for aws, too much is logged under the default INFO | ||
com.amazonaws: WARN | ||
|
||
appender: | ||
console: | ||
type: console | ||
layout: | ||
type: consolePattern | ||
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" |
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,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Add elasticsearch as command if needed | ||
if [ "${1:0:1}" = '-' ]; then | ||
set -- elasticsearch "$@" | ||
fi | ||
|
||
# Drop root privileges if we are running elasticsearch | ||
# allow the container to be started with `--user` | ||
if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then | ||
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch | ||
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data | ||
|
||
set -- su-exec elasticsearch "$@" | ||
#exec su-exec elasticsearch "$BASH_SOURCE" "$@" | ||
fi | ||
|
||
# As argument is not related to elasticsearch, | ||
# then assume that user wants to run his own process, | ||
# for example a `bash` shell to explore this image | ||
exec "$@" |
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
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,76 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
# ensure elasticsearch user exists | ||
RUN addgroup -S elasticsearch && adduser -S -G elasticsearch elasticsearch | ||
|
||
# grab su-exec for easy step-down from root | ||
# and bash for "bin/elasticsearch" among others | ||
RUN apk add --no-cache 'su-exec>=0.2' bash | ||
|
||
# https://artifacts.elastic.co/GPG-KEY-elasticsearch | ||
ENV GPG_KEY 46095ACC8548582C1A2699A9D27D666CD88E42B4 | ||
|
||
WORKDIR /usr/share/elasticsearch | ||
ENV PATH /usr/share/elasticsearch/bin:$PATH | ||
|
||
ENV ELASTICSEARCH_VERSION 2.4.2 | ||
ENV ELASTICSEARCH_TARBALL="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.2.tar.gz" \ | ||
ELASTICSEARCH_TARBALL_ASC="https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-2.4.2.tar.gz.asc" \ | ||
ELASTICSEARCH_TARBALL_SHA1="25effa2daacf5ba65151103dd47339fd88826756" | ||
|
||
RUN set -ex; \ | ||
\ | ||
apk add --no-cache --virtual .fetch-deps \ | ||
ca-certificates \ | ||
gnupg \ | ||
openssl \ | ||
tar \ | ||
; \ | ||
\ | ||
wget -O elasticsearch.tar.gz "$ELASTICSEARCH_TARBALL"; \ | ||
\ | ||
if [ "$ELASTICSEARCH_TARBALL_SHA1" ]; then \ | ||
echo "$ELASTICSEARCH_TARBALL_SHA1 *elasticsearch.tar.gz" | sha1sum -c -; \ | ||
fi; \ | ||
\ | ||
if [ "$ELASTICSEARCH_TARBALL_ASC" ]; then \ | ||
wget -O elasticsearch.tar.gz.asc "$ELASTICSEARCH_TARBALL_ASC"; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \ | ||
gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ | ||
rm -r "$GNUPGHOME" elasticsearch.tar.gz.asc; \ | ||
fi; \ | ||
\ | ||
tar -xf elasticsearch.tar.gz --strip-components=1; \ | ||
rm elasticsearch.tar.gz; \ | ||
\ | ||
apk del .fetch-deps; \ | ||
\ | ||
mkdir -p ./plugins; \ | ||
for path in \ | ||
./data \ | ||
./logs \ | ||
./config \ | ||
./config/scripts \ | ||
; do \ | ||
mkdir -p "$path"; \ | ||
chown -R elasticsearch:elasticsearch "$path"; \ | ||
done; \ | ||
\ | ||
if [ "${ELASTICSEARCH_VERSION%%.*}" -gt 1 ]; then \ | ||
elasticsearch --version; \ | ||
else \ | ||
# elasticsearch 1.x doesn't support --version | ||
# but in 5.x, "-v" is verbose (and "-V" is --version) | ||
elasticsearch -v; \ | ||
fi | ||
|
||
COPY config ./config | ||
|
||
VOLUME /usr/share/elasticsearch/data | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
EXPOSE 9200 9300 | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["elasticsearch"] |
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 @@ | ||
network.host: 0.0.0.0 |
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,15 @@ | ||
# you can override this using by setting a system property, for example -Des.logger.level=DEBUG | ||
es.logger.level: INFO | ||
rootLogger: ${es.logger.level}, console | ||
logger: | ||
# log action execution errors for easier debugging | ||
action: DEBUG | ||
# reduce the logging for aws, too much is logged under the default INFO | ||
com.amazonaws: WARN | ||
|
||
appender: | ||
console: | ||
type: console | ||
layout: | ||
type: consolePattern | ||
conversionPattern: "[%d{ISO8601}][%-5p][%-25c] %m%n" |
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,23 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
# Add elasticsearch as command if needed | ||
if [ "${1:0:1}" = '-' ]; then | ||
set -- elasticsearch "$@" | ||
fi | ||
|
||
# Drop root privileges if we are running elasticsearch | ||
# allow the container to be started with `--user` | ||
if [ "$1" = 'elasticsearch' -a "$(id -u)" = '0' ]; then | ||
# Change the ownership of /usr/share/elasticsearch/data to elasticsearch | ||
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/data | ||
|
||
set -- su-exec elasticsearch "$@" | ||
#exec su-exec elasticsearch "$BASH_SOURCE" "$@" | ||
fi | ||
|
||
# As argument is not related to elasticsearch, | ||
# then assume that user wants to run his own process, | ||
# for example a `bash` shell to explore this image | ||
exec "$@" |
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
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,76 @@ | ||
FROM openjdk:8-jre-alpine | ||
|
||
# ensure elasticsearch user exists | ||
RUN addgroup -S elasticsearch && adduser -S -G elasticsearch elasticsearch | ||
|
||
# grab su-exec for easy step-down from root | ||
# and bash for "bin/elasticsearch" among others | ||
RUN apk add --no-cache 'su-exec>=0.2' bash | ||
|
||
# https://artifacts.elastic.co/GPG-KEY-elasticsearch | ||
ENV GPG_KEY 46095ACC8548582C1A2699A9D27D666CD88E42B4 | ||
|
||
WORKDIR /usr/share/elasticsearch | ||
ENV PATH /usr/share/elasticsearch/bin:$PATH | ||
|
||
ENV ELASTICSEARCH_VERSION 5.1.1 | ||
ENV ELASTICSEARCH_TARBALL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.tar.gz" \ | ||
ELASTICSEARCH_TARBALL_ASC="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.tar.gz.asc" \ | ||
ELASTICSEARCH_TARBALL_SHA1="7351cd29ac9c20592d94bde950f513b5c5bb44d3" | ||
|
||
RUN set -ex; \ | ||
\ | ||
apk add --no-cache --virtual .fetch-deps \ | ||
ca-certificates \ | ||
gnupg \ | ||
openssl \ | ||
tar \ | ||
; \ | ||
\ | ||
wget -O elasticsearch.tar.gz "$ELASTICSEARCH_TARBALL"; \ | ||
\ | ||
if [ "$ELASTICSEARCH_TARBALL_SHA1" ]; then \ | ||
echo "$ELASTICSEARCH_TARBALL_SHA1 *elasticsearch.tar.gz" | sha1sum -c -; \ | ||
fi; \ | ||
\ | ||
if [ "$ELASTICSEARCH_TARBALL_ASC" ]; then \ | ||
wget -O elasticsearch.tar.gz.asc "$ELASTICSEARCH_TARBALL_ASC"; \ | ||
export GNUPGHOME="$(mktemp -d)"; \ | ||
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPG_KEY"; \ | ||
gpg --batch --verify elasticsearch.tar.gz.asc elasticsearch.tar.gz; \ | ||
rm -r "$GNUPGHOME" elasticsearch.tar.gz.asc; \ | ||
fi; \ | ||
\ | ||
tar -xf elasticsearch.tar.gz --strip-components=1; \ | ||
rm elasticsearch.tar.gz; \ | ||
\ | ||
apk del .fetch-deps; \ | ||
\ | ||
mkdir -p ./plugins; \ | ||
for path in \ | ||
./data \ | ||
./logs \ | ||
./config \ | ||
./config/scripts \ | ||
; do \ | ||
mkdir -p "$path"; \ | ||
chown -R elasticsearch:elasticsearch "$path"; \ | ||
done; \ | ||
\ | ||
if [ "${ELASTICSEARCH_VERSION%%.*}" -gt 1 ]; then \ | ||
elasticsearch --version; \ | ||
else \ | ||
# elasticsearch 1.x doesn't support --version | ||
# but in 5.x, "-v" is verbose (and "-V" is --version) | ||
elasticsearch -v; \ | ||
fi | ||
|
||
COPY config ./config | ||
|
||
VOLUME /usr/share/elasticsearch/data | ||
|
||
COPY docker-entrypoint.sh / | ||
|
||
EXPOSE 9200 9300 | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["elasticsearch"] |
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,5 @@ | ||
network.host: 0.0.0.0 | ||
|
||
# this value is required because we set "network.host" | ||
# be sure to modify it appropriately for a production cluster deployment | ||
discovery.zen.minimum_master_nodes: 1 |
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,9 @@ | ||
status = error | ||
|
||
appender.console.type = Console | ||
appender.console.name = console | ||
appender.console.layout.type = PatternLayout | ||
appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] %marker%m%n | ||
|
||
rootLogger.level = info | ||
rootLogger.appenderRef.console.ref = console |
Oops, something went wrong.