diff --git a/Dockerfile.sample b/Dockerfile.sample index db489e0..2d29b94 100644 --- a/Dockerfile.sample +++ b/Dockerfile.sample @@ -1,15 +1,19 @@ -FROM fluent/fluentd:v1.10-1 +FROM fluent/fluentd:v1.19-debian MAINTAINER YOUR_NAME <...@...> USER root -RUN apk add --no-cache --update --virtual .build-deps \ - sudo build-base ruby-dev \ - # customize following instruction as you wish - && sudo gem install fluent-plugin-elasticsearch \ +RUN buildDeps="sudo make gcc g++ libc-dev" \ + && apt-get update \ + && apt-get install -y --no-install-recommends $buildDeps \ + && gem install fluent-plugin-concat \ && sudo gem sources --clear-all \ - && apk del .build-deps \ - && rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem + && SUDO_FORCE_REMOVE=yes \ + apt-get purge -y --auto-remove \ + -o APT::AutoRemove::RecommendsImportant=false \ + $buildDeps \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem COPY fluent.conf /fluentd/etc/ COPY entrypoint.sh /bin/ diff --git a/HOWTOBUILD.md b/HOWTOBUILD.md index ee62802..df8f037 100644 --- a/HOWTOBUILD.md +++ b/HOWTOBUILD.md @@ -35,38 +35,15 @@ Documentation of `fluent.conf` is available at [docs.fluentd.org][3]. ### 3. Customize Dockerfile to install plugins (optional) You can install [Fluentd plugins][4] using Dockerfile. -Sample Dockerfile installs `fluent-plugin-elasticsearch`. +Sample Dockerfile installs `fluent-plugin-concat`. To add plugins, edit `Dockerfile` as following: About deprecated old images, see [DEPRECATED](DEPRECATED.md). -#### Alpine version - -```Dockerfile -FROM fluent/fluentd:v1.17-1 - -# Use root account to use apk -USER root - -# below RUN includes plugin as examples elasticsearch is not required -# you may customize including plugins as you wish -RUN apk add --no-cache --update --virtual .build-deps \ - sudo build-base ruby-dev \ - && sudo gem install fluent-plugin-elasticsearch \ - && sudo gem sources --clear-all \ - && apk del .build-deps \ - && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem - -COPY fluent.conf /fluentd/etc/ -COPY entrypoint.sh /bin/ - -USER fluent -``` - #### Debian version ```Dockerfile -FROM fluent/fluentd:v1.17-debian-1 +FROM fluent/fluentd:v1.19-debian # Use root account to use apt USER root @@ -76,7 +53,7 @@ USER root RUN buildDeps="sudo make gcc g++ libc-dev" \ && apt-get update \ && apt-get install -y --no-install-recommends $buildDeps \ - && sudo gem install fluent-plugin-elasticsearch \ + && sudo gem install fluent-plugin-concat \ && sudo gem sources --clear-all \ && SUDO_FORCE_REMOVE=yes \ apt-get purge -y --auto-remove \ @@ -93,7 +70,7 @@ USER fluent #### Note -These example run `apk add`/`apt-get install` to be able to install +These example run `apt-get install` to be able to install Fluentd plugins which require native extensions (they are removed immediately after plugin installation). If you're sure that plugins don't include native extensions, you can omit it