CentOS-升级ELK log4j版本的Dockerfile

CentOS-升级ELK log4j版本的Dockerfile,第1张

CentOS-升级ELK log4j版本的Dockerfile

hostnamectl
Static hostname: practice-20–copy-from-centos-10
Icon name: computer-vm
Chassis: vm
Machine ID: b2b9ec09b6d149f68b86efa0e28e868e
Boot ID: 817b51122db440ce83892e32c8767bd1
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-693.el7.x86_64
Architecture: x86-64

vim Dockerfile-elasticsearch7.1.1-log4j2.17.1

FROM docker.io/elasticsearch:7.1.1
RUN find / -name "log4j*" | grep 2.11.1 | xargs rm -rf
RUN wget -q --no-check-certificate  https://dlcdn.apache.org/logging/log4j/2.17.1/apache-log4j-2.17.1-bin.tar.gz -O /tmp/apache-log4j-2.17.1-bin.tar.gz 
   && cd /tmp 
   && tar xf apache-log4j-2.17.1-bin.tar.gz
RUN cp  /tmp/apache-log4j-2.17.1-bin/{log4j-1.2-api-2.17.1.jar,log4j-api-2.17.1.jar,log4j-core-2.17.1.jar}  /usr/share/elasticsearch/lib/ 
   && cp  /tmp/apache-log4j-2.17.1-bin/log4j-slf4j-impl-2.17.1.jar /usr/share/elasticsearch/modules/x-pack-security/ 
   && rm -rf /tmp/apache-log4j-2.17.1-bin.tar.gz /tmp/apache-log4j-2.17.1-bin
RUN find / -name "log4j*" | grep 2.17.1

vim Dockerfile-logstash7.1.1-log4j2.17.1

FROM docker.io/logstash:7.1.1
RUN find / -name "log4j*" -type f | grep 2.11.1 | xargs rm -rf
USER root
RUN yum install -y -q wget 
   &&  wget -q --no-check-certificate  https://dlcdn.apache.org/logging/log4j/2.17.1/apache-log4j-2.17.1-bin.tar.gz -O /tmp/apache-log4j-2.17.1-bin.tar.gz 
   && cd /tmp 
   && tar xf apache-log4j-2.17.1-bin.tar.gz
RUN cp  /tmp/apache-log4j-2.17.1-bin/{log4j-1.2-api-2.17.1.jar,log4j-api-2.17.1.jar,log4j-core-2.17.1.jar}  /usr/share/logstash/logstash-core/lib/jars/ 
   && mv /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-beats-6.0.0-java/vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.11.1/  /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-beats-6.0.0-java/vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.17.1/ 
   && mv /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http-3.3.0-java/vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.11.1/  /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http-3.3.0-java/vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.17.1/ 
   && echo /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-beats-6.0.0-java/vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.17.1/  /usr/share/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-input-http-3.3.0-java/vendor/jar-dependencies/org/apache/logging/log4j/log4j-api/2.17.1/ | xargs -n 1 cp /tmp/apache-log4j-2.17.1-bin/log4j-slf4j-impl-2.17.1.jar 
   && rm -rf /tmp/apache-log4j-2.17.1-bin.tar.gz /tmp/apache-log4j-2.17.1-bin

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5710773.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存