From 25f8dd8bce638a6a904c806a91e419165595844a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Ko=C5=82odziejczyk?= Date: Sat, 3 Feb 2024 17:15:14 +0100 Subject: [PATCH] [RORDEV-1095] docker images improvements (#982) --- docker-image/init-readonlyrest.yml | 1 - docker-image/ror-entrypoint-es6x.sh | 22 ++++++++++++++++++++++ docker-image/ror-entrypoint.sh | 21 +++++++++++++++++++++ es60x/build.gradle | 2 +- es61x/build.gradle | 2 +- es62x/build.gradle | 2 +- es63x/Dockerfile | 12 ++++++++++-- es63x/build.gradle | 2 +- es65x/Dockerfile | 12 ++++++++++-- es65x/build.gradle | 2 +- es66x/Dockerfile | 12 ++++++++++-- es66x/build.gradle | 2 +- es67x/Dockerfile | 12 ++++++++++-- es67x/build.gradle | 2 +- es70x/Dockerfile | 12 ++++++++++-- es70x/build.gradle | 2 +- es710x/Dockerfile | 12 ++++++++++-- es710x/build.gradle | 2 +- es711x/Dockerfile | 12 ++++++++++-- es711x/build.gradle | 2 +- es714x/Dockerfile | 12 ++++++++++-- es714x/build.gradle | 2 +- es716x/Dockerfile | 13 +++++++++++-- es716x/build.gradle | 2 +- es717x/Dockerfile | 13 +++++++++++-- es717x/build.gradle | 2 +- es72x/Dockerfile | 12 ++++++++++-- es72x/build.gradle | 2 +- es73x/Dockerfile | 12 ++++++++++-- es73x/build.gradle | 2 +- es74x/Dockerfile | 12 ++++++++++-- es74x/build.gradle | 2 +- es77x/Dockerfile | 12 ++++++++++-- es77x/build.gradle | 2 +- es78x/Dockerfile | 12 ++++++++++-- es78x/build.gradle | 2 +- es79x/Dockerfile | 12 ++++++++++-- es79x/build.gradle | 2 +- es80x/Dockerfile | 13 +++++++++++-- es80x/build.gradle | 2 +- es810x/Dockerfile | 13 +++++++++++-- es810x/build.gradle | 2 +- es811x/Dockerfile | 13 +++++++++++-- es811x/build.gradle | 2 +- es812x/Dockerfile | 13 +++++++++++-- es812x/build.gradle | 2 +- es81x/Dockerfile | 13 +++++++++++-- es81x/build.gradle | 2 +- es82x/Dockerfile | 13 +++++++++++-- es82x/build.gradle | 2 +- es83x/Dockerfile | 13 +++++++++++-- es83x/build.gradle | 2 +- es84x/Dockerfile | 13 +++++++++++-- es84x/build.gradle | 2 +- es85x/Dockerfile | 13 +++++++++++-- es85x/build.gradle | 2 +- es87x/Dockerfile | 13 +++++++++++-- es87x/build.gradle | 2 +- es88x/Dockerfile | 13 +++++++++++-- es88x/build.gradle | 2 +- es89x/Dockerfile | 13 +++++++++++-- es89x/build.gradle | 2 +- 62 files changed, 368 insertions(+), 88 deletions(-) create mode 100755 docker-image/ror-entrypoint-es6x.sh create mode 100755 docker-image/ror-entrypoint.sh diff --git a/docker-image/init-readonlyrest.yml b/docker-image/init-readonlyrest.yml index 50ecf08683..60f072ca53 100644 --- a/docker-image/init-readonlyrest.yml +++ b/docker-image/init-readonlyrest.yml @@ -8,5 +8,4 @@ readonlyrest: - name: "ADMIN" type: allow - verbosity: error auth_key: admin:${env:ADMIN_USER_PASS} \ No newline at end of file diff --git a/docker-image/ror-entrypoint-es6x.sh b/docker-image/ror-entrypoint-es6x.sh new file mode 100755 index 0000000000..12b7f91080 --- /dev/null +++ b/docker-image/ror-entrypoint-es6x.sh @@ -0,0 +1,22 @@ +#!/bin/bash -e + +INVOKE_ROR_TOOLS="$JAVA_HOME/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar" + +if $INVOKE_ROR_TOOLS verify | grep -q "Elasticsearch is NOT patched"; then + + if [ -n "$I_UNDERSTAND_IMPLICATION_OF_ES_PATCHING" ] && [[ "${I_UNDERSTAND_IMPLICATION_OF_ES_PATCHING,,}" == *"yes"* ]]; then + $INVOKE_ROR_TOOLS patch + else + echo "Elasticsearch needs to be patched to work with ReadonlyREST. You can read about patching in our documentation:" \ + "https://docs.readonlyrest.com/elasticsearch#id-3.-patch-elasticsearch. In this Docker image, the patching step" \ + "is done automatically, but you must agree to have it done for you. You can do this by setting" \ + "I_UNDERSTAND_IMPLICATION_OF_ES_PATCHING=yes environment variable when running the container." + exit 1 + fi + +else + echo "Elasticsearch is already patched. We can continue ..." +fi + + +gosu elasticsearch /usr/local/bin/docker-entrypoint.sh "$@" \ No newline at end of file diff --git a/docker-image/ror-entrypoint.sh b/docker-image/ror-entrypoint.sh new file mode 100755 index 0000000000..bcb7e73884 --- /dev/null +++ b/docker-image/ror-entrypoint.sh @@ -0,0 +1,21 @@ +#!/bin/bash -e + +INVOKE_ROR_TOOLS="/usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar" + +if $INVOKE_ROR_TOOLS verify | grep -q "Elasticsearch is NOT patched"; then + + if [ -n "$I_UNDERSTAND_IMPLICATION_OF_ES_PATCHING" ] && [[ "${I_UNDERSTAND_IMPLICATION_OF_ES_PATCHING,,}" == *"yes"* ]]; then + $INVOKE_ROR_TOOLS patch + else + echo "Elasticsearch needs to be patched to work with ReadonlyREST. You can read about patching in our documentation:" \ + "https://docs.readonlyrest.com/elasticsearch#id-3.-patch-elasticsearch. In this Docker image, the patching step" \ + "is done automatically, but you must agree to have it done for you. You can do this by setting" \ + "I_UNDERSTAND_IMPLICATION_OF_ES_PATCHING=yes environment variable when running the container." + exit 1 + fi + +else + echo "Elasticsearch is already patched. We can continue ..." +fi + +gosu elasticsearch /usr/local/bin/docker-entrypoint.sh "$@" \ No newline at end of file diff --git a/es60x/build.gradle b/es60x/build.gradle index 2cf7604fef..5d79fd5087 100644 --- a/es60x/build.gradle +++ b/es60x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es61x/build.gradle b/es61x/build.gradle index 2cf7604fef..5d79fd5087 100644 --- a/es61x/build.gradle +++ b/es61x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es62x/build.gradle b/es62x/build.gradle index 8a6cf82243..90b4a2b75d 100644 --- a/es62x/build.gradle +++ b/es62x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es63x/Dockerfile b/es63x/Dockerfile index dbe533f2ce..ca845f7f92 100644 --- a/es63x/Dockerfile +++ b/es63x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint-es6x.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN $JAVA_HOME/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es63x/build.gradle b/es63x/build.gradle index 4034a7312e..b8b02ee5a5 100644 --- a/es63x/build.gradle +++ b/es63x/build.gradle @@ -141,7 +141,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es65x/Dockerfile b/es65x/Dockerfile index dbe533f2ce..ca845f7f92 100644 --- a/es65x/Dockerfile +++ b/es65x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint-es6x.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN $JAVA_HOME/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es65x/build.gradle b/es65x/build.gradle index ce7991207c..2d8cddbfad 100644 --- a/es65x/build.gradle +++ b/es65x/build.gradle @@ -131,7 +131,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es66x/Dockerfile b/es66x/Dockerfile index dbe533f2ce..ca845f7f92 100644 --- a/es66x/Dockerfile +++ b/es66x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint-es6x.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN $JAVA_HOME/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es66x/build.gradle b/es66x/build.gradle index f3d2667d20..f63d7fd838 100644 --- a/es66x/build.gradle +++ b/es66x/build.gradle @@ -131,7 +131,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es67x/Dockerfile b/es67x/Dockerfile index dbe533f2ce..ca845f7f92 100644 --- a/es67x/Dockerfile +++ b/es67x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint-es6x.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN $JAVA_HOME/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es67x/build.gradle b/es67x/build.gradle index 89d5a2cf12..115a423079 100644 --- a/es67x/build.gradle +++ b/es67x/build.gradle @@ -137,7 +137,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es70x/Dockerfile b/es70x/Dockerfile index e83077dbf3..0efdd1ef8d 100644 --- a/es70x/Dockerfile +++ b/es70x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es70x/build.gradle b/es70x/build.gradle index ce7991207c..2d8cddbfad 100644 --- a/es70x/build.gradle +++ b/es70x/build.gradle @@ -131,7 +131,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es710x/Dockerfile b/es710x/Dockerfile index e83077dbf3..5a74ecc5f9 100644 --- a/es710x/Dockerfile +++ b/es710x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es710x/build.gradle b/es710x/build.gradle index db9739bce4..8d1f3d916c 100644 --- a/es710x/build.gradle +++ b/es710x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es711x/Dockerfile b/es711x/Dockerfile index e83077dbf3..5dacce5fcb 100644 --- a/es711x/Dockerfile +++ b/es711x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es711x/build.gradle b/es711x/build.gradle index 1b56401586..364a71d919 100644 --- a/es711x/build.gradle +++ b/es711x/build.gradle @@ -137,7 +137,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es714x/Dockerfile b/es714x/Dockerfile index e83077dbf3..5dacce5fcb 100644 --- a/es714x/Dockerfile +++ b/es714x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es714x/build.gradle b/es714x/build.gradle index d45c0ea9c3..da522a3225 100644 --- a/es714x/build.gradle +++ b/es714x/build.gradle @@ -131,7 +131,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es716x/Dockerfile b/es716x/Dockerfile index e83077dbf3..0c5e5e9773 100644 --- a/es716x/Dockerfile +++ b/es716x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es716x/build.gradle b/es716x/build.gradle index 4a6253ce1f..cfd1dbaeb7 100644 --- a/es716x/build.gradle +++ b/es716x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es717x/Dockerfile b/es717x/Dockerfile index e83077dbf3..0c5e5e9773 100644 --- a/es717x/Dockerfile +++ b/es717x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es717x/build.gradle b/es717x/build.gradle index a66a3d1bc1..b890d24a1f 100644 --- a/es717x/build.gradle +++ b/es717x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es72x/Dockerfile b/es72x/Dockerfile index e83077dbf3..0efdd1ef8d 100644 --- a/es72x/Dockerfile +++ b/es72x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es72x/build.gradle b/es72x/build.gradle index ce7991207c..2d8cddbfad 100644 --- a/es72x/build.gradle +++ b/es72x/build.gradle @@ -131,7 +131,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es73x/Dockerfile b/es73x/Dockerfile index e83077dbf3..0efdd1ef8d 100644 --- a/es73x/Dockerfile +++ b/es73x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es73x/build.gradle b/es73x/build.gradle index ce7991207c..2d8cddbfad 100644 --- a/es73x/build.gradle +++ b/es73x/build.gradle @@ -131,7 +131,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es74x/Dockerfile b/es74x/Dockerfile index e83077dbf3..0efdd1ef8d 100644 --- a/es74x/Dockerfile +++ b/es74x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es74x/build.gradle b/es74x/build.gradle index 89e46cacf7..b493fa783e 100644 --- a/es74x/build.gradle +++ b/es74x/build.gradle @@ -138,7 +138,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es77x/Dockerfile b/es77x/Dockerfile index e83077dbf3..5a74ecc5f9 100644 --- a/es77x/Dockerfile +++ b/es77x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es77x/build.gradle b/es77x/build.gradle index db9739bce4..8d1f3d916c 100644 --- a/es77x/build.gradle +++ b/es77x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es78x/Dockerfile b/es78x/Dockerfile index e83077dbf3..5a74ecc5f9 100644 --- a/es78x/Dockerfile +++ b/es78x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es78x/build.gradle b/es78x/build.gradle index db9739bce4..8d1f3d916c 100644 --- a/es78x/build.gradle +++ b/es78x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es79x/Dockerfile b/es79x/Dockerfile index e83077dbf3..5a74ecc5f9 100644 --- a/es79x/Dockerfile +++ b/es79x/Dockerfile @@ -9,12 +9,20 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.17/gosu-amd64" && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es79x/build.gradle b/es79x/build.gradle index db9739bce4..8d1f3d916c 100644 --- a/es79x/build.gradle +++ b/es79x/build.gradle @@ -132,7 +132,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es80x/Dockerfile b/es80x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es80x/Dockerfile +++ b/es80x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es80x/build.gradle b/es80x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es80x/build.gradle +++ b/es80x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es810x/Dockerfile b/es810x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es810x/Dockerfile +++ b/es810x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es810x/build.gradle b/es810x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es810x/build.gradle +++ b/es810x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es811x/Dockerfile b/es811x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es811x/Dockerfile +++ b/es811x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es811x/build.gradle b/es811x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es811x/build.gradle +++ b/es811x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es812x/Dockerfile b/es812x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es812x/Dockerfile +++ b/es812x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es812x/build.gradle b/es812x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es812x/build.gradle +++ b/es812x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es81x/Dockerfile b/es81x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es81x/Dockerfile +++ b/es81x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es81x/build.gradle b/es81x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es81x/build.gradle +++ b/es81x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es82x/Dockerfile b/es82x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es82x/Dockerfile +++ b/es82x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es82x/build.gradle b/es82x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es82x/build.gradle +++ b/es82x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es83x/Dockerfile b/es83x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es83x/Dockerfile +++ b/es83x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es83x/build.gradle b/es83x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es83x/build.gradle +++ b/es83x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es84x/Dockerfile b/es84x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es84x/Dockerfile +++ b/es84x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es84x/build.gradle b/es84x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es84x/build.gradle +++ b/es84x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es85x/Dockerfile b/es85x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es85x/Dockerfile +++ b/es85x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es85x/build.gradle b/es85x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es85x/build.gradle +++ b/es85x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es87x/Dockerfile b/es87x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es87x/Dockerfile +++ b/es87x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es87x/build.gradle b/es87x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es87x/build.gradle +++ b/es87x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es88x/Dockerfile b/es88x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es88x/Dockerfile +++ b/es88x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es88x/build.gradle b/es88x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es88x/build.gradle +++ b/es88x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") } diff --git a/es89x/Dockerfile b/es89x/Dockerfile index e83077dbf3..4330589294 100644 --- a/es89x/Dockerfile +++ b/es89x/Dockerfile @@ -9,12 +9,21 @@ ARG ROR_VERSION ENV KIBANA_USER_PASS=kibana ENV ADMIN_USER_PASS=admin +USER root + +RUN apt-get update && \ + apt-get install -y --no-install-recommends gosu && \ + rm -rf /var/lib/apt/lists/* && \ + gosu nobody true + +USER elasticsearch + COPY readonlyrest-${ROR_VERSION}_es${ES_VERSION}.zip /tmp/readonlyrest.zip COPY init-readonlyrest.yml /usr/share/elasticsearch/config/readonlyrest.yml +COPY ror-entrypoint.sh /usr/local/bin/ror-entrypoint.sh RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:///tmp/readonlyrest.zip USER root -RUN /usr/share/elasticsearch/jdk/bin/java -jar /usr/share/elasticsearch/plugins/readonlyrest/ror-tools.jar patch -USER 1000:0 \ No newline at end of file +ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/ror-entrypoint.sh"] \ No newline at end of file diff --git a/es89x/build.gradle b/es89x/build.gradle index 754af44669..fb12ee02b1 100644 --- a/es89x/build.gradle +++ b/es89x/build.gradle @@ -133,7 +133,7 @@ tasks.register('prepareDockerImageFiles', Copy) { from layout.projectDirectory.file("Dockerfile") from layout.buildDirectory.file("distributions/" + pluginFullName + ".zip") - from rootProject.file("docker-image/init-readonlyrest.yml") + from rootProject.files("docker-image") into layout.buildDirectory.dir("docker-image") }