# This Dockerfile was generated from templates/Dockerfile.erb

                      
                # Minimal distributions do not ship with en language packs.
      
FROM redhat/ubi8-minimal:latest

RUN for iter in {1..10}; do \
    microdnf update -y && \
  microdnf upgrade -y && \
  microdnf install -y procps findutils tar gzip && \
      microdnf install -y openssl && \
        microdnf install -y which shadow-utils && \
        microdnf install -y curl && \
    microdnf clean all && \
  exit_code=0 && break || exit_code=$? && \
echo "packaging error: retry $iter in 10s" && \
microdnf clean all && \
sleep 10; done; \
(exit $exit_code)

# Provide a non-root user to run the process.
RUN groupadd --gid 1000 logstash && \
  adduser --uid 1000 --gid 1000 --home /usr/share/logstash --no-create-home logstash

# Add Logstash itself.
RUN curl -Lo - https://artifacts.elastic.co/downloads/logstash/logstash-8.19.19-SNAPSHOT-linux-$(arch).tar.gz | \
  tar zxf - -C /usr/share && \
  mv /usr/share/logstash-8.19.19-SNAPSHOT /usr/share/logstash && \
  chown --recursive logstash:logstash /usr/share/logstash/ && \
  chown -R logstash:root /usr/share/logstash && \
  chmod -R g=u /usr/share/logstash && \
  mkdir /licenses/ && \
  mv /usr/share/logstash/NOTICE.TXT /licenses/NOTICE.TXT && \
  mv /usr/share/logstash/LICENSE.txt /licenses/LICENSE.txt && \
  find /usr/share/logstash -type d -exec chmod g+s {} \; && \
  ln -s /usr/share/logstash /opt/logstash

WORKDIR /usr/share/logstash
ENV ELASTIC_CONTAINER true
ENV PATH=/usr/share/logstash/bin:$PATH


# Provide a minimal configuration, so that simple invocations will provide
# a good experience.
  COPY config/logstash-full.yml config/logstash.yml
COPY config/pipelines.yml config/log4j2.properties config/log4j2.file.properties config/
COPY pipeline/default.conf pipeline/logstash.conf

RUN chown --recursive logstash:root config/ pipeline/
# Ensure Logstash gets the correct locale by default.
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8


COPY --chown=logstash:root env2yaml/classes /usr/share/logstash/env2yaml/classes/
COPY --chown=logstash:root env2yaml/lib /usr/share/logstash/env2yaml/lib/
COPY --chmod=0755 env2yaml/env2yaml /usr/local/bin/env2yaml
# Place the startup wrapper script.
COPY bin/docker-entrypoint /usr/local/bin/

RUN chmod 0755 /usr/local/bin/docker-entrypoint


USER 1000

EXPOSE 9600 5044

LABEL  org.label-schema.schema-version="1.0" \
  org.label-schema.vendor="Elastic" \
  org.opencontainers.image.vendor="Elastic" \
  org.label-schema.name="logstash" \
  org.opencontainers.image.title="logstash" \
  org.label-schema.version="8.19.19-SNAPSHOT" \
  org.opencontainers.image.version="8.19.19-SNAPSHOT" \
  org.label-schema.url="https://www.elastic.co/products/logstash" \
  org.label-schema.vcs-url="https://github.com/elastic/logstash" \
  org.label-schema.license="Elastic License" \
  org.opencontainers.image.licenses="Elastic License" \
  org.opencontainers.image.description="Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite 'stash.'" \
  org.label-schema.build-date=2026-07-10T02:53:34+00:00 \
  license="Elastic License" \
  description="Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite 'stash.'" \
  name="logstash" \
  maintainer="info@elastic.co" \
  summary="Logstash is a free and open server-side data processing pipeline that ingests data from a multitude of sources, transforms it, and then sends it to your favorite 'stash.'" \
  vendor="Elastic" \
  org.opencontainers.image.created=2026-07-10T02:53:34+00:00

ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]