Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java upgrade (Fix #21) and entry point wrapper. #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,30 @@
#

# Pull base image.
FROM dockerfile/java:oracle-java8
FROM ggtools/java8

ENV ES_PKG_NAME elasticsearch-1.4.2

# Install Elasticsearch.
RUN \
cd / && \
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/$ES_PKG_NAME.tar.gz && \
tar xvzf $ES_PKG_NAME.tar.gz && \
rm -f $ES_PKG_NAME.tar.gz && \
curl -k https://download.elasticsearch.org/elasticsearch/elasticsearch/$ES_PKG_NAME.tar.gz | \
tar -xvzf - && \
mv /$ES_PKG_NAME /elasticsearch

# Define mountable directories.
VOLUME ["/data"]

# Mount elasticsearch.yml config
ADD config/elasticsearch.yml /elasticsearch/config/elasticsearch.yml
ADD docker-entry-point.sh /elasticsearch/bin/docker-entry-point.sh

# Define working directory.
WORKDIR /data

# Define default command.
CMD ["/elasticsearch/bin/elasticsearch"]
ENTRYPOINT [ "/elasticsearch/bin/docker-entry-point.sh" ]
CMD [""]

# Expose ports.
# - 9200: HTTP
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This repository contains **Dockerfile** of [Elasticsearch](http://www.elasticsea

### Base Docker Image

* [dockerfile/java:oracle-java8](http://dockerfile.github.io/#/java)
* [ggtools/java8](https://registry.hub.docker.com/u/ggtools/java8)


### Installation
Expand Down Expand Up @@ -37,7 +37,7 @@ This repository contains **Dockerfile** of [Elasticsearch](http://www.elasticsea
3. Start a container by mounting data directory and specifying the custom configuration file:

```sh
docker run -d -p 9200:9200 -p 9300:9300 -v <data-dir>:/data dockerfile/elasticsearch /elasticsearch/bin/elasticsearch -Des.config=/data/elasticsearch.yml
docker run -d -p 9200:9200 -p 9300:9300 -v <data-dir>:/data dockerfile/elasticsearch -Des.config=/data/elasticsearch.yml
```

After few seconds, open `http://<host>:9200` to see the result.
11 changes: 11 additions & 0 deletions docker-entry-point.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

set -e

if [ -z "$1" -o "${1:0:1}" = '-' ]; then
chown -R default /data

exec gosu default /elasticsearch/bin/elasticsearch "$@"
fi

exec "$@"