-
Notifications
You must be signed in to change notification settings - Fork 223
Expand file tree
/
Copy pathDockerfile
More file actions
83 lines (67 loc) · 3.38 KB
/
Dockerfile
File metadata and controls
83 lines (67 loc) · 3.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# This Dockerfile was generated from templates/Dockerfile.erb
# Build env2yaml
FROM golang:1.25 AS builder-env2yaml
COPY env2yaml/env2yaml.go env2yaml/go.mod env2yaml/go.sum /tmp/go/src/env2yaml/
WORKDIR /tmp/go/src/env2yaml
RUN go build -trimpath
# Build main image
# Minimal distributions do not ship with en language packs.
FROM redhat/ubi9-minimal:latest
ENV ELASTIC_CONTAINER=true
ENV PATH=/usr/share/logstash/bin:$PATH
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
WORKDIR /usr/share
# Install packages
RUN \
microdnf install -y procps findutils tar gzip && \
microdnf install -y openssl && \
microdnf install -y which shadow-utils && \
microdnf clean all
# Provide a non-root user to run the process
# Add Logstash itself and set permissions
RUN groupadd --gid 1000 logstash && \
adduser --uid 1000 --gid 1000 \
--home "/usr/share/logstash" \
--no-create-home \
logstash && \
arch="$(rpm --query --queryformat='%{ARCH}' rpm)" && \
curl -f -Lo logstash.tar.gz https://artifacts.elastic.co/downloads/logstash/logstash-9.1.8-linux-${arch}.tar.gz && \
tar -zxf logstash.tar.gz -C /usr/share && \
rm logstash.tar.gz && \
mv /usr/share/logstash-9.1.8 /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
COPY --from=builder-env2yaml /tmp/go/src/env2yaml/env2yaml /usr/local/bin/env2yaml
COPY --chown=logstash:root config/pipelines.yml config/log4j2.properties config/log4j2.file.properties /usr/share/logstash/config/
COPY --chown=logstash:root config/logstash-full.yml /usr/share/logstash/config/logstash.yml
COPY --chown=logstash:root pipeline/default.conf /usr/share/logstash/pipeline/logstash.conf
COPY --chmod=0755 bin/docker-entrypoint /usr/local/bin/
WORKDIR /usr/share/logstash
USER 1000
EXPOSE 9600 5044
LABEL org.label-schema.build-date=2025-11-25T19:41:48+00:00 \
org.label-schema.license="Elastic License" \
org.label-schema.name="logstash" \
org.label-schema.schema-version="1.0" \
org.label-schema.url="https://www.elastic.co/products/logstash" \
org.label-schema.vcs-url="https://github.com/elastic/logstash" \
org.label-schema.vendor="Elastic" \
org.label-schema.version="9.1.8" \
org.opencontainers.image.created=2025-11-25T19:41:48+00:00 \
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.opencontainers.image.licenses="Elastic License" \
org.opencontainers.image.title="logstash" \
org.opencontainers.image.vendor="Elastic" \
org.opencontainers.image.version="9.1.8" \
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.'" \
license="Elastic License" \
maintainer="info@elastic.co" \
name="logstash" \
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"
ENTRYPOINT ["/usr/local/bin/docker-entrypoint"]