2016-07-23 17:29:27 +00:00
|
|
|
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
|
2017-05-02 07:23:09 +00:00
|
|
|
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
|
2016-09-07 17:15:01 +00:00
|
|
|
|
|
|
|
{% block telegraf_header %}{% endblock %}
|
|
|
|
|
2016-07-23 17:29:27 +00:00
|
|
|
{% import "macros.j2" as macros with context %}
|
|
|
|
|
2016-12-18 19:11:47 +00:00
|
|
|
{{ macros.configure_user(name='telegraf', homedir='/etc/telegraf') }}
|
|
|
|
|
2017-05-10 01:22:53 +00:00
|
|
|
{% set telegraf_packages = [
|
|
|
|
'net-tools',
|
2017-05-17 02:59:16 +00:00
|
|
|
'python-pip',
|
2017-05-10 01:22:53 +00:00
|
|
|
'telegraf'
|
|
|
|
] %}
|
2017-07-21 03:06:08 +00:00
|
|
|
|
|
|
|
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
|
|
|
|
{% set telegraf_packages = telegraf_packages + [
|
|
|
|
'collectd'
|
|
|
|
] %}
|
|
|
|
{% elif base_distro in ['debian', 'ubuntu'] %}
|
|
|
|
{% set telegraf_packages = telegraf_packages + [
|
|
|
|
'collectd-core'
|
|
|
|
] %}
|
|
|
|
{% endif %}
|
|
|
|
|
2016-08-11 22:24:11 +00:00
|
|
|
{{ macros.install_packages(telegraf_packages | customizable("packages")) }}
|
2016-07-23 17:29:27 +00:00
|
|
|
|
|
|
|
COPY telegraf_sudoers /etc/sudoers.d/kolla_telegraf_sudoers
|
2017-01-11 10:00:51 +00:00
|
|
|
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
2016-09-12 13:28:14 +00:00
|
|
|
|
2016-07-23 17:29:27 +00:00
|
|
|
RUN chmod 750 /etc/sudoers.d \
|
|
|
|
&& chmod 440 /etc/sudoers.d/kolla_telegraf_sudoers \
|
2016-12-18 19:11:47 +00:00
|
|
|
&& chmod 755 /usr/local/bin/kolla_extend_start
|
2016-07-23 17:29:27 +00:00
|
|
|
|
|
|
|
{% block telegraf_footer %}{% endblock %}
|
|
|
|
{% block footer %}{% endblock %}
|
|
|
|
|
|
|
|
USER telegraf
|