ivankrizsan/elastalert docker 图片错误

ivankrizsan/elastalert docker image error

我正在尝试使用 elastalert 作为 docker 使用 compose 的容器。 以下是我的 dokcer-compose 文件中的 elastalert 定义: elastalert:

image: ivankrizsan/elastalert
container_name: elastalert
restart: unless-stopped
privileged: true
links:
  - es:elasticsearchhost
ports:
  - "3030:3030"            
cap_add:
  - SYS_TIME
  - SYS_NICE
volumes:
  - /etc/elastalert/config:/opt/config
  - /etc/elastalert/rules:/opt/rules
  - /etc/elastalert/logs:/opt/logs
  - /etc/elastalert:/opt/elastalert
environment:
  - ELASTICSEARCH_HOST=es
  - ELASTICSEARCH_PORT=9200  

我收到以下错误:

Container timezone not modified  
{  
"name" : "Stunner",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "jqqJxdQZRP6cLJPBd0Usdg",
"version" : {
"number" : "2.4.5",
"build_hash" : "c849dd13904f53e63e88efc33b2ceeda0b6a1276",
"build_timestamp" : "2017-04-24T16:18:17Z",
"build_snapshot" : false,
"lucene_version" : "5.5.4"
},  
"tagline" : "You Know, for Search"  
}  
Creating Elastalert index in Elasticsearch...  
Traceback (most recent call last):  
File "/usr/bin/elastalert-create-index", line 6, in <module>
from pkg_resources import load_entry_point  
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3019, in   <module>
@_call_aside  
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3003, in _call_aside
f(args, *kwargs)  
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 3032, in _initialize_master_working_set
working_set = WorkingSet._build_master()  
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 655, in _build_master
ws.require(requires)  
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 963, in require
needed = self.resolve(parse_requirements(requirements))  
File "/usr/lib/python2.7/site-packages/pkg_resources/init.py", line 849, in resolve
raise DistributionNotFound(req, requirers)  
pkg_resources.DistributionNotFound: The 'elastalert' distribution was not found and is required by the application 

我能够解决问题。 docker-撰写对我有用的配置:

elastalert:

image: ivankrizsan/elastalert

container_name: elastalert

restart: unless-stopped

privileged: true

links:
        - es:elasticsearchhost

cap_add:

 - SYS_TIME

 - SYS_NICE

volumes:     

  - /etc/elastalert/config:/opt/config

  - /etc/elastalert/rules:/opt/rules

  - /etc/elastalert/logs:/opt/logs      

environment:

  - ELASTICSEARCH_HOST=es

  - ELASTICSEARCH_PORT=9200