mirror of
https://github.com/elastic/logstash.git
synced 2025-04-21 13:18:16 -04:00
Set of changes to make Logstash compatible to JRuby 9.4. Bundle JRuby 9.4.3.0 - Redefine space token in `LSCL` and `grammar` treetop from `_` which would generated methods in the form `def _0` (deprecated since `2.7`) to `sc`. - `I18n.t` method doesn't accept hash as second argument - `URI.encode` has been replaced with same functionality with `URI::Parser.new.escape` - `YAML.load` needs explicit `fallback: false` to return false when the yaml string is empty (or contains only comments) - JRuby's `JavaClass` has been removed, now it can use `java.lang.Class` directly - explicitly require gem `thwait` to satisfy `require "thwait"` (In `Gemfile.template` and `logstash-core/logstash-core.gemspec`) - fix not args `clone` to be `def clone(*args)` - fix `Enumeration.each_slice` which from `Ruby 3.1` is [chainable](https://rubyreferences.github.io/rubychanges/3.1.html#enumerableeach_cons-and-each_slice-return-a-receiver) and doesn't return `nil`. JRuby fixed in https://github.com/jruby/jruby/issues/7015 - Expanded `Down.download` arguments map ca16bbed3c302006967413eb9d3862f2da81f7ae - Avoid to pass `nil` in the list of couples used in `Hash[ <list of couples> ]` which from Ruby `3.0` generates an `ArgumentError` - Removed space not allowed between method name and parentheses `initialize (` is forbidden. 29b607dcdef98f81a73ad171639fd13aaa65e243 - With [Ruby 2.7 the `Kernel#open`](https://rubyreferences.github.io/rubychanges/2.7.html#network-and-web) doesn't fallback to `URI#open`, fixed test code that used that to verify open port. e5b70de54c5301f51a767da67294092af0cfafdc - Avoid to drop `rdoc/` folder from vendored JRuby else `bin/logstash -i irb` would crash, commit b71f73e9c6edb81a7b7ae1305047e506f61c6e8c Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
64 lines
No EOL
2.4 KiB
Docker
64 lines
No EOL
2.4 KiB
Docker
FROM ubuntu:bionic
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y zlib1g-dev build-essential vim rake git curl libssl-dev libreadline-dev libyaml-dev \
|
|
libxml2-dev libxslt-dev openjdk-11-jdk-headless curl iputils-ping netcat && \
|
|
apt-get clean
|
|
|
|
WORKDIR /root
|
|
|
|
RUN adduser --disabled-password --gecos "" --home /home/logstash logstash && \
|
|
mkdir -p /usr/local/share/ruby-build && \
|
|
mkdir -p /opt/logstash && \
|
|
mkdir -p /opt/logstash/data && \
|
|
mkdir -p /mnt/host && \
|
|
chown logstash:logstash /opt/logstash
|
|
|
|
USER logstash
|
|
WORKDIR /home/logstash
|
|
|
|
# used by the purge policy
|
|
LABEL retention="keep"
|
|
|
|
# Setup gradle wrapper. When running any `gradle` command, a `settings.gradle` is expected (and will soon be required).
|
|
# This section adds the gradle wrapper, `settings.gradle` and sets the permissions (setting the user to root for `chown`
|
|
# and working directory to allow this and then reverts back to the previous working directory and user.
|
|
COPY --chown=logstash:logstash gradlew /opt/logstash/gradlew
|
|
COPY --chown=logstash:logstash gradle/wrapper /opt/logstash/gradle/wrapper
|
|
COPY --chown=logstash:logstash settings.gradle /opt/logstash/settings.gradle
|
|
WORKDIR /opt/logstash
|
|
RUN for iter in `seq 1 10`; do ./gradlew wrapper --warning-mode all && exit_code=0 && break || exit_code=$? && echo "gradlew error: retry $iter in 10s" && sleep 10; done; exit $exit_code
|
|
WORKDIR /home/logstash
|
|
|
|
COPY versions.yml /opt/logstash/versions.yml
|
|
COPY LICENSE.txt /opt/logstash/LICENSE.txt
|
|
COPY NOTICE.TXT /opt/logstash/NOTICE.TXT
|
|
COPY licenses /opt/logstash/licenses
|
|
COPY CONTRIBUTORS /opt/logstash/CONTRIBUTORS
|
|
COPY Gemfile.template Gemfile.jruby-3.1.lock.* /opt/logstash/
|
|
COPY Rakefile /opt/logstash/Rakefile
|
|
COPY build.gradle /opt/logstash/build.gradle
|
|
COPY rubyUtils.gradle /opt/logstash/rubyUtils.gradle
|
|
COPY rakelib /opt/logstash/rakelib
|
|
COPY config /opt/logstash/config
|
|
COPY spec /opt/logstash/spec
|
|
COPY qa /opt/logstash/qa
|
|
COPY lib /opt/logstash/lib
|
|
COPY pkg /opt/logstash/pkg
|
|
COPY buildSrc /opt/logstash/buildSrc
|
|
COPY tools /opt/logstash/tools
|
|
COPY logstash-core /opt/logstash/logstash-core
|
|
COPY logstash-core-plugin-api /opt/logstash/logstash-core-plugin-api
|
|
COPY bin /opt/logstash/bin
|
|
COPY modules /opt/logstash/modules
|
|
COPY x-pack /opt/logstash/x-pack
|
|
COPY ci /opt/logstash/ci
|
|
|
|
USER root
|
|
RUN rm -rf build && \
|
|
mkdir -p build && \
|
|
chown -R logstash:logstash /opt/logstash
|
|
USER logstash
|
|
WORKDIR /opt/logstash
|
|
|
|
LABEL retention="prune" |