Skip to content

Commit 152cca5

Browse files
author
Ryan Miller
authored
Merge pull request #125 from SumoLogic/rmiller-debian-fluentd-deployment
Switch to Debian fluentd Dockerfile
2 parents 040a10c + b68e9c9 commit 152cca5

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

deploy/docker/Dockerfile

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
FROM fluent/fluentd:v1.6.3-1.0
1+
FROM fluent/fluentd:v1.6.3-debian-1.0
22

3-
# Use root account to use apk
3+
# Use root account to use apt
44
USER root
55

6-
COPY gems/fluent-plugin*.gem ./
7-
8-
RUN apk add --no-cache libexecinfo libexecinfo-dev
6+
# Build dependencies
7+
RUN buildDeps="sudo make gcc g++ libc-dev ruby-dev libsnappy-dev" \
8+
&& apt-get update \
9+
&& apt-get install -y --no-install-recommends $buildDeps
910

10-
RUN apk add --no-cache snappy g++ snappy-dev
11+
COPY gems/fluent-plugin*.gem ./
1112

12-
RUN apk add --no-cache --update --virtual .build-deps sudo build-base ruby-dev \
13-
&& gem install concurrent-ruby \
13+
# Fluentd plugin dependencies
14+
RUN gem install concurrent-ruby \
1415
&& gem install google-protobuf \
1516
&& gem install kubeclient \
1617
&& gem install lru_redux \
@@ -40,14 +41,15 @@ RUN gem install fluent-plugin-prometheus-format \
4041
&& gem install fluent-plugin-protobuf \
4142
&& gem install fluent-plugin-events
4243

43-
RUN gem sources --clear-all \
44-
&& apk del .build-deps \
45-
&& rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem \
46-
&& rm -f ./*.gem
47-
48-
RUN mkdir -p /fluentd/conf.d
44+
RUN sudo gem sources --clear-all \
45+
&& SUDO_FORCE_REMOVE=yes \
46+
apt-get purge -y --auto-remove \
47+
-o APT::AutoRemove::RecommendsImportant=false \
48+
$buildDeps \
49+
&& rm -rf /var/lib/apt/lists/* \
50+
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
4951

5052
COPY ./fluent.conf /fluentd/etc/
51-
COPY entrypoint.sh /bin/
53+
COPY ./entrypoint.sh /bin/
5254

5355
USER fluent

deploy/kubernetes/fluentd-sumologic.yaml.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,15 +328,15 @@ spec:
328328
command:
329329
- "/bin/sh"
330330
- "-c"
331-
- "[[ $( pgrep ruby | wc -l) == 2 ]]"
331+
- "[ $(pgrep ruby | wc -l) -gt 0 ]"
332332
initialDelaySeconds: 300
333333
periodSeconds: 20
334334
readinessProbe:
335335
exec:
336336
command:
337337
- "/bin/sh"
338338
- "-c"
339-
- "[[ $( pgrep ruby | wc -l) == 2 ]]"
339+
- "[ $(pgrep ruby | wc -l) -gt 0 ]"
340340
initialDelaySeconds: 30
341341
periodSeconds: 5
342342
volumeMounts:
@@ -513,15 +513,15 @@ spec:
513513
command:
514514
- "/bin/sh"
515515
- "-c"
516-
- "[[ $( pgrep ruby | wc -l) == 2 ]]"
516+
- "[ $(pgrep ruby | wc -l) -gt 0 ]"
517517
initialDelaySeconds: 300
518518
periodSeconds: 20
519519
readinessProbe:
520520
exec:
521521
command:
522522
- "/bin/sh"
523523
- "-c"
524-
- "[[ $( pgrep ruby | wc -l) == 2 ]]"
524+
- "[ $(pgrep ruby | wc -l) -gt 0 ]"
525525
initialDelaySeconds: 30
526526
periodSeconds: 5
527527
env:

0 commit comments

Comments
 (0)