Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Dockerfile.sample
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
31 changes: 4 additions & 27 deletions HOWTOBUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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
Expand Down