Skip to content

Commit

Permalink
exiftool
Browse files Browse the repository at this point in the history
  • Loading branch information
labudzinski committed Jan 2, 2024
1 parent fecc442 commit 23c2aaf
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 0 deletions.
67 changes: 67 additions & 0 deletions elastic/8.9/Dockerfile
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"]
6 changes: 6 additions & 0 deletions elastic/8.9/config/elastic/elasticsearch.yml
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
254 changes: 254 additions & 0 deletions elastic/8.9/config/elastic/log4j2.properties

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions elastic/8.9/config/logrotate
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
}
16 changes: 16 additions & 0 deletions elastic/8.9/docker-healthcheck
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
45 changes: 45 additions & 0 deletions elastic/8.9/elastic-entrypoint.sh
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 "$@"
3 changes: 3 additions & 0 deletions mariadb-dump/Dockerfile
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
Expand Down
3 changes: 3 additions & 0 deletions nginx/Dockerfile
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
Expand Down
1 change: 1 addition & 0 deletions php/8.2-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RUN /bin/sh -c set -eux; \
jpegoptim \
optipng \
pngquant \
exiftool \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS

RUN update-ca-certificates
Expand Down
1 change: 1 addition & 0 deletions php/8.2-supervisor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ RUN apk add --no-cache \
ttf-freefont \
ttf-liberation \
supervisor \
exiftool \
&& rm -rf /tmp/* /var/cache/apk/*

COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/libwkhtmltox.so /bin/
Expand Down

0 comments on commit 23c2aaf

Please sign in to comment.