Skip to content

Commit addb2b8

Browse files
authored
Update HOWTOBUILD.md (#458)
* Drop deprecated Alpine Signed-off-by: Kentaro Hayashi <[email protected]> * Update to debian based image Closes: #399 Signed-off-by: Kentaro Hayashi <[email protected]> --------- Signed-off-by: Kentaro Hayashi <[email protected]>
1 parent 1a76c98 commit addb2b8

File tree

2 files changed

+15
-34
lines changed

2 files changed

+15
-34
lines changed

Dockerfile.sample

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
FROM fluent/fluentd:v1.10-1
1+
FROM fluent/fluentd:v1.19-debian
22
MAINTAINER YOUR_NAME <...@...>
33

44
USER root
55

6-
RUN apk add --no-cache --update --virtual .build-deps \
7-
sudo build-base ruby-dev \
8-
# customize following instruction as you wish
9-
&& sudo gem install fluent-plugin-elasticsearch \
6+
RUN buildDeps="sudo make gcc g++ libc-dev" \
7+
&& apt-get update \
8+
&& apt-get install -y --no-install-recommends $buildDeps \
9+
&& gem install fluent-plugin-concat \
1010
&& sudo gem sources --clear-all \
11-
&& apk del .build-deps \
12-
&& rm -rf /home/fluent/.gem/ruby/2.5.0/cache/*.gem
11+
&& SUDO_FORCE_REMOVE=yes \
12+
apt-get purge -y --auto-remove \
13+
-o APT::AutoRemove::RecommendsImportant=false \
14+
$buildDeps \
15+
&& rm -rf /var/lib/apt/lists/* \
16+
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
1317

1418
COPY fluent.conf /fluentd/etc/
1519
COPY entrypoint.sh /bin/

HOWTOBUILD.md

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,38 +35,15 @@ Documentation of `fluent.conf` is available at [docs.fluentd.org][3].
3535
### 3. Customize Dockerfile to install plugins (optional)
3636

3737
You can install [Fluentd plugins][4] using Dockerfile.
38-
Sample Dockerfile installs `fluent-plugin-elasticsearch`.
38+
Sample Dockerfile installs `fluent-plugin-concat`.
3939
To add plugins, edit `Dockerfile` as following:
4040

4141
About deprecated old images, see [DEPRECATED](DEPRECATED.md).
4242

43-
#### Alpine version
44-
45-
```Dockerfile
46-
FROM fluent/fluentd:v1.17-1
47-
48-
# Use root account to use apk
49-
USER root
50-
51-
# below RUN includes plugin as examples elasticsearch is not required
52-
# you may customize including plugins as you wish
53-
RUN apk add --no-cache --update --virtual .build-deps \
54-
sudo build-base ruby-dev \
55-
&& sudo gem install fluent-plugin-elasticsearch \
56-
&& sudo gem sources --clear-all \
57-
&& apk del .build-deps \
58-
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem
59-
60-
COPY fluent.conf /fluentd/etc/
61-
COPY entrypoint.sh /bin/
62-
63-
USER fluent
64-
```
65-
6643
#### Debian version
6744

6845
```Dockerfile
69-
FROM fluent/fluentd:v1.17-debian-1
46+
FROM fluent/fluentd:v1.19-debian
7047

7148
# Use root account to use apt
7249
USER root
@@ -76,7 +53,7 @@ USER root
7653
RUN buildDeps="sudo make gcc g++ libc-dev" \
7754
&& apt-get update \
7855
&& apt-get install -y --no-install-recommends $buildDeps \
79-
&& sudo gem install fluent-plugin-elasticsearch \
56+
&& sudo gem install fluent-plugin-concat \
8057
&& sudo gem sources --clear-all \
8158
&& SUDO_FORCE_REMOVE=yes \
8259
apt-get purge -y --auto-remove \
@@ -93,7 +70,7 @@ USER fluent
9370

9471
#### Note
9572

96-
These example run `apk add`/`apt-get install` to be able to install
73+
These example run `apt-get install` to be able to install
9774
Fluentd plugins which require native extensions (they are removed immediately
9875
after plugin installation).
9976
If you're sure that plugins don't include native extensions, you can omit it

0 commit comments

Comments
 (0)