-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fecc442
commit 23c2aaf
Showing
10 changed files
with
407 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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
ARG TARGETARCH=amd64 | ||
|
||
FROM alpine:3.15 as base-amd64 | ||
RUN echo ${TARGETARCH} | ||
ARG ARCH="linux-x86_64" | ||
|
||
|
||
FROM alpine:3.15 as base-arm64 | ||
RUN echo ${TARGETARCH} | ||
ARG ARCH="linux-aarch64" | ||
|
||
FROM base-${TARGETARCH} as base | ||
LABEL Maintainer="Dominik Labudzinski <[email protected]>" \ | ||
Description="Elastic 8.9.2 with essential extensions on top of Alpine Linux." | ||
|
||
RUN apk add --no-cache openjdk17-jre-headless su-exec | ||
|
||
ENV VERSION 8.9.2 | ||
ENV DOWNLOAD_URL "https://artifacts.elastic.co/downloads/elasticsearch" | ||
ENV ES_TARBAL "${DOWNLOAD_URL}/elasticsearch-${VERSION}-${ARCH}.tar.gz" | ||
|
||
RUN apk add --no-cache bash | ||
RUN apk add --no-cache -t .build-deps wget ca-certificates gnupg openssl \ | ||
&& set -ex \ | ||
&& cd /tmp \ | ||
&& echo "===> Install Elasticsearch..." \ | ||
&& wget --progress=bar:force -O elasticsearch.tar.gz "$ES_TARBAL"; \ | ||
tar -xf elasticsearch.tar.gz \ | ||
&& ls -lah \ | ||
&& mv elasticsearch-$VERSION /usr/share/elasticsearch \ | ||
&& adduser -D -h /usr/share/elasticsearch elasticsearch \ | ||
&& echo "===> Creating Elasticsearch Paths..." \ | ||
&& for path in \ | ||
/usr/share/elasticsearch/data \ | ||
/usr/share/elasticsearch/logs \ | ||
/usr/share/elasticsearch/config \ | ||
/usr/share/elasticsearch/config/scripts \ | ||
/usr/share/elasticsearch/tmp \ | ||
/usr/share/elasticsearch/plugins \ | ||
; do \ | ||
mkdir -p "$path"; \ | ||
chown -R elasticsearch:elasticsearch "$path"; \ | ||
done \ | ||
&& rm -rf /tmp/* /usr/share/elasticsearch/jdk \ | ||
&& apk del --purge .build-deps | ||
|
||
# TODO: remove this (it removes X-Pack ML so it works on Alpine) | ||
RUN rm -rf /usr/share/elasticsearch/modules/x-pack-ml/platform/${ARCH} | ||
|
||
COPY elastic/8.9/config/elastic /usr/share/elasticsearch/config | ||
COPY elastic/8.9/config/logrotate /etc/logrotate.d/elasticsearch | ||
COPY elastic/8.9/elastic-entrypoint.sh / | ||
RUN chmod +x /elastic-entrypoint.sh | ||
COPY elastic/8.9/docker-healthcheck /usr/local/bin/ | ||
|
||
WORKDIR /usr/share/elasticsearch | ||
|
||
ENV PATH /usr/share/elasticsearch/bin:$PATH | ||
ENV ES_TMPDIR /usr/share/elasticsearch/tmp | ||
|
||
VOLUME ["/usr/share/elasticsearch/data"] | ||
|
||
EXPOSE 9200 9300 | ||
ENTRYPOINT ["/elastic-entrypoint.sh"] | ||
CMD ["elasticsearch"] | ||
|
||
HEALTHCHECK CMD ["docker-healthcheck"] |
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,6 @@ | ||
cluster.name: "docker-cluster" | ||
network.host: 0.0.0.0 | ||
|
||
discovery.type: "single-node" | ||
xpack.ml.enabled: false | ||
xpack.security.enabled: false |
Large diffs are not rendered by default.
Oops, something went wrong.
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,11 @@ | ||
/var/log/elasticsearch/*.log { | ||
daily | ||
rotate 50 | ||
size 50M | ||
copytruncate | ||
compress | ||
delaycompress | ||
missingok | ||
notifempty | ||
create 644 elasticsearch 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,16 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
host="$(hostname --ip-address || echo '127.0.0.1')" | ||
|
||
if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then | ||
health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") | ||
if [ "$health" = 'green' ]; then | ||
exit 0 | ||
fi | ||
echo >&2 "unexpected health status: $health" | ||
fi | ||
|
||
# If the probe returns 2 ("starting") when the container has already moved out of the "starting" state then it is treated as "unhealthy" instead. | ||
# https://github.com/docker/docker/blob/dcc65376bac8e73bb5930fce4cddc2350bb7baa2/docs/reference/builder.md#healthcheck | ||
exit 2 |
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,45 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
umask 0002 | ||
|
||
declare -a es_opts | ||
|
||
while IFS='=' read -r envvar_key envvar_value | ||
do | ||
# Elasticsearch env vars need to have at least two dot separated lowercase words, e.g. `cluster.name` | ||
if [[ "$envvar_key" =~ ^[a-z0-9_]+\.[a-z0-9_]+ ]]; then | ||
if [[ ! -z $envvar_value ]]; then | ||
es_opt="-E${envvar_key}=${envvar_value}" | ||
es_opts+=("${es_opt}") | ||
fi | ||
fi | ||
done < <(env) | ||
|
||
export ES_JAVA_HOME=$(dirname "$(dirname "$(readlink -f "$(which javac || which java)")")") | ||
export ES_JAVA_OPTS="-Des.cgroups.hierarchy.override=/ $ES_JAVA_OPTS" | ||
|
||
# Determine if x-pack is enabled | ||
if bin/elasticsearch-plugin list -s | grep -q x-pack; then | ||
if [[ -n "$ELASTIC_PASSWORD" ]]; then | ||
[[ -f config/elasticsearch.keystore ]] || bin/elasticsearch-keystore create | ||
echo "$ELASTIC_PASSWORD" | bin/elasticsearch-keystore add -x 'bootstrap.password' | ||
fi | ||
fi | ||
|
||
# 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 user-mutable directories to elasticsearch | ||
chown -R elasticsearch:elasticsearch /usr/share/elasticsearch/{data,logs} | ||
|
||
set -- su-exec elasticsearch "$@" "${es_opts[@]}" | ||
fi | ||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
FROM alpine:latest | ||
LABEL Maintainer="Dominik Labudzinski <[email protected]>" \ | ||
Description="MaridBD Dump with essential extensions on top of Alpine Linux." | ||
|
||
RUN apk add --update mariadb-client bash openssh-client && rm -rf /var/cache/apk/* | ||
COPY mariadb-dump/dump.sh /usr/bin/dump | ||
RUN chmod +x /usr/bin/dump | ||
|
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
FROM nginx:mainline-alpine-slim | ||
|
||
LABEL Maintainer="Dominik Labudzinski <[email protected]>" \ | ||
Description="Nginx with essential extensions on top of Alpine Linux." | ||
|
||
ARG PUID=82 | ||
ARG GUID=82 | ||
ARG TZ=Europe/Warsaw | ||
|
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