解决
Failed to get D-Bus connection: Operation not permitted
1、使用systemctl enable logstash 将服务设置成开机启动
2、Dockerfile中指定 CMD ["/usr/sbin/init”]
docker run --privileged -d -it -v /data/test:/opt/logstash -e TZ=Asia/Tokyo reg.ptone.jp/base/logstash
或者
1、使用systemctl enable logstash 将服务设置成开机启动
2、添加脚本
ADD ./start.sh /usr/local/bin/start.shRUN chmod +x /usr/local/bin/start.shCMD ["/usr/local/bin/start.sh"]
3、
[root@dn-5-228 elk-docker]# cat start.sh#!/bin/bashexec /usr/sbin/init docker run --privileged -d -it -v /data/test:/opt/logstash -e TZ=Asia/Tokyo reg.ptone.jp/base/logstash