Browse Source

bump es to 6.3

master
dave 3 years ago
parent
commit
7536cb33af
  1. 1
      .dockerignore
  2. 42
      Dockerfile
  3. 2
      README.md
  4. 4
      elasticsearch.conf
  5. 36
      get_oracle_jdk_linux_x64.sh
  6. 7
      start

1
.dockerignore

@ -0,0 +1 @@
data

42
Dockerfile

@ -1,22 +1,26 @@
FROM ubuntu:trusty
RUN apt-get update ;\
apt-get install -y software-properties-common ;\
add-apt-repository -y ppa:webupd8team/java ;\
apt-get update ;\
echo "debconf shared/accepted-oracle-license-v1-1 select true" | debconf-set-selections;\
apt-get install -y oracle-java9-installer ;\
rm -rf /var/lib/apt/lists/*
RUN apt-get update ;\
apt-get install -y curl supervisor ;\
curl -o /tmp/elasticsearch.deb "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.3.1.deb" ;\
dpkg -i /tmp/elasticsearch.deb ;\
rm /tmp/elasticsearch.deb ;\
sed -i -E 's/(\-Xm.[0-9]g)/#\1/' /etc/elasticsearch/jvm.options ;\
rm -rf /var/lib/apt/lists/*
ADD elasticsearch.conf /etc/supervisor/conf.d/elasticsearch.conf
FROM ubuntu:bionic
RUN apt-get update && \
apt-get install -y wget curl
ADD get_oracle_jdk_linux_x64.sh /
RUN /get_oracle_jdk_linux_x64.sh 8 tar.gz && \
mkdir -p /srv/java/8 && \
tar xvf java.tar.gz -C /srv/java/8/ --strip-components=1
FROM ubuntu:bionic
COPY --from=0 /srv /srv
ENV PATH=/srv/java/8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUN apt-get update && apt-get install -yqq wget && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb
RUN wget -qO /tmp/elasticsearch.deb "https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.2.deb" && \
dpkg -i /tmp/elasticsearch.deb && \
rm /tmp/elasticsearch.deb && \
sed -i -E 's|^[^#]|#\0|' /etc/elasticsearch/elasticsearch.yml && \
sed -i -E 's/(\-Xm.[0-9]g)/#\1/' /etc/elasticsearch/jvm.options
ADD start /start
VOLUME /var/lib/elasticsearch/

2
README.md

@ -1,7 +1,7 @@
docker-elasticsearch
====================
The latest [Elasticsearch](https://www.elastic.co/products/elasticsearch) for docker, currently 5.3.1.
The latest [Elasticsearch](https://www.elastic.co/products/elasticsearch) for docker, currently 6.3.2.
*Usage:*

4
elasticsearch.conf

@ -1,4 +0,0 @@
[program:elasticsearch]
command=/usr/share/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --default.path.home=/usr/share/elasticsearch --default.path.logs=/var/log/elasticsearch --default.path.data=/var/lib/elasticsearch --default.path.work=/tmp/elasticsearch --default.path.conf=/etc/elasticsearch
user=elasticsearch
redirect_stderr=true

36
get_oracle_jdk_linux_x64.sh

@ -0,0 +1,36 @@
#!/bin/bash
# https://gist.github.com/n0ts/40dd9bd45578556f93e7
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz
jdk_version=${1:-8}
ext=${2:-rpm}
readonly url="http://www.oracle.com"
readonly jdk_download_url1="$url/technetwork/java/javase/downloads/index.html"
readonly jdk_download_url2=$(
curl -s $jdk_download_url1 | \
egrep -o "\/technetwork\/java/\javase\/downloads\/jdk${jdk_version}-downloads-.+?\.html" | \
head -1 | \
cut -d '"' -f 1
)
[[ -z "$jdk_download_url2" ]] && echo "Could not get jdk download url - $jdk_download_url1" >> /dev/stderr
readonly jdk_download_url3="${url}${jdk_download_url2}"
readonly jdk_download_url4=$(
curl -s $jdk_download_url3 | \
egrep -o "http\:\/\/download.oracle\.com\/otn-pub\/java\/jdk\/[8-9](u[0-9]+|\+).*\/jdk-${jdk_version}.*(-|_)linux-(x64|x64_bin).$ext"
)
for dl_url in ${jdk_download_url4[@]}; do
wget --no-cookies \
--no-check-certificate \
--header "Cookie: oraclelicense=accept-securebackup-cookie" \
-N $dl_url \
-O java.tar.gz
done

7
start

@ -1,11 +1,10 @@
#!/bin/sh
export ES_JAVA_OPTS="${ES_JAVA_OPTS:--Xms1G -Xmx1G}"
export ES_PATH_CONF=/etc/elasticsearch
exec /usr/share/elasticsearch/bin/elasticsearch \
-p /var/run/elasticsearch/elasticsearch.pid \
-E default.path.home=/usr/share/elasticsearch \
-E default.path.logs=/var/log/elasticsearch \
-E default.path.data=/var/lib/elasticsearch \
-E default.path.conf=/etc/elasticsearch \
-E path.logs=/var/log/elasticsearch \
-E path.data=/var/lib/elasticsearch \
-E network.host=0.0.0.0 $@

Loading…
Cancel
Save