-
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.
Closes #96
- Loading branch information
Showing
5 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ language: bash | |
services: docker | ||
|
||
env: | ||
- VERSION=5.0 | ||
- VERSION=2.3 | ||
- VERSION=2.2 | ||
- VERSION=2.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,53 @@ | ||
FROM java:8-jre | ||
|
||
# grab gosu for easy step-down from root | ||
ENV GOSU_VERSION 1.7 | ||
RUN set -x \ | ||
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ | ||
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ | ||
&& export GNUPGHOME="$(mktemp -d)" \ | ||
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ | ||
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ | ||
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ | ||
&& chmod +x /usr/local/bin/gosu \ | ||
&& gosu nobody true | ||
|
||
# https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | ||
# https://packages.elasticsearch.org/GPG-KEY-elasticsearch | ||
RUN apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 46095ACC8548582C1A2699A9D27D666CD88E42B4 | ||
|
||
ENV ELASTICSEARCH_MAJOR 5.0 | ||
ENV ELASTICSEARCH_VERSION 5.0.0~alpha1 | ||
ENV ELASTICSEARCH_REPO_BASE http://packages.elasticsearch.org/elasticsearch/5.x/debian | ||
|
||
RUN echo "deb $ELASTICSEARCH_REPO_BASE stable main" > /etc/apt/sources.list.d/elasticsearch.list | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends elasticsearch=$ELASTICSEARCH_VERSION \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV PATH /usr/share/elasticsearch/bin:$PATH | ||
|
||
WORKDIR /usr/share/elasticsearch | ||
|
||
RUN set -ex \ | ||
&& for path in \ | ||
./data \ | ||
./logs \ | ||
./config \ | ||
./config/scripts \ | ||
; do \ | ||
mkdir -p "$path"; \ | ||
chown -R elasticsearch:elasticsearch "$path"; \ | ||
done | ||
|
||
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 -- gosu elasticsearch "$@" | ||
#exec gosu 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 "$@" |