forked from JNPRAutomate/fluent-plugin-juniper-telemetry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
78 lines (64 loc) · 2.43 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM fluent/fluentd:v0.12.29
MAINTAINER Damien Garros <[email protected]>
USER root
WORKDIR /home/fluent
## Install python
RUN apk update \
&& apk add python-dev py-pip \
&& pip install --upgrade pip \
&& pip install envtpl
# && apk del -r --purge gcc make g++ \
# && rm -rf /var/cache/apk/*
ENV PATH /home/fluent/.gem/ruby/2.2.0/bin:$PATH
RUN apk --no-cache --update add \
build-base \
ruby-dev && \
echo 'gem: --no-document' >> /etc/gemrc
RUN gem install --no-ri --no-rdoc \
statsd-ruby \
dogstatsd-ruby \
bigdecimal
# apk del build-base ruby-dev && \
# rm -rf /tmp/* /var/tmp/* /var/cache/apk/*
RUN apk add gcc
RUN apk update &&\
apk add ca-certificates &&\
update-ca-certificates &&\
apk add openssl
# RUN cd /tmp && \
# wget https://github.com/google/protobuf/releases/download/v3.0.0-beta-3/protobuf-cpp-3.0.0-beta-3.tar.gz&&\
# tar -xzf protobuf-cpp-3.0.0-beta-3.tar.gz &&\
# cd protobuf-3.0.0-beta-3 &&\
# ./configure --prefix=/usr &&\
# make &&\
# make install
#
RUN cd /tmp && \
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz &&\
tar -xzf protobuf-2.6.1.tar.gz &&\
cd protobuf-2.6.1 &&\
./configure --prefix=/usr &&\
make &&\
make install
WORKDIR /home/fluent/
RUN mkdir fluentd-plugin-juniper-telemetry
ADD fluentd/fluentd.launcher.sh fluentd.sh
RUN chmod +x fluentd.sh
ENV RUBYLIB /home/fluent/fluentd-plugin-juniper-telemetry/lib
RUN gem install --prerelease protobuf
# RUN gem install --prerelease google-protobuf
COPY junos-telemetry/compile_protofile.sh compile_protofile.sh
USER fluent
# RUN export PATH="/home/fluent:$PATH"
# RUN wget https://github.com/google/protobuf/releases/download/v3.0.0-beta-3/protoc-3.0.0-beta-3-linux-x86_32.zip
# RUN unzip protoc-3.0.0-beta-3-linux-x86_32.zip
WORKDIR /home/fluent/
# Copy Start script to generate configuration dynamically
#ADD fluentd-alpine.start.sh fluentd-alpine.start.sh
#RUN chown -R fluent:fluent fluentd-alpine.start.sh
#RUN chmod 777 fluentd-alpine.start.sh
USER fluent
EXPOSE 24284
CMD fluentd -c /home/fluent/fluentd-plugin-juniper-telemetry/fluentd/fluent.conf \
-v \
-p /home/fluent/fluentd-plugin-juniper-telemetry/lib/fluent/plugin