Skip to content

Commit

Permalink
Add Fluentd v1.13.0 images
Browse files Browse the repository at this point in the history
Closes: #269

Signed-off-by: Kentaro Hayashi <[email protected]>
  • Loading branch information
kenhys committed Jun 7, 2021
1 parent c238dc4 commit 43c67d1
Show file tree
Hide file tree
Showing 33 changed files with 970 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
fail-fast: false
matrix:
include:
- dockerfile: v1.12/alpine
- dockerfile: v1.12/debian
- dockerfile: v1.13/alpine
- dockerfile: v1.13/debian
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@

IMAGE_NAME := fluent/fluentd
X86_IMAGES := \
v1.12/alpine:v1.12.4-1.0,v1.12-1,edge \
v1.12/debian:v1.12.4-debian-1.0,v1.12-debian-1,edge-debian
v1.13/alpine:v1.13.0-1.0,v1.13-1,edge \
v1.13/debian:v1.13.0-debian-1.0,v1.13-debian-1,edge-debian
# <Dockerfile>:<version>,<tag1>,<tag2>,...

# Define images for running on ARM platforms
ARM_IMAGES := \
v1.12/armhf/debian:v1.12.4-debian-armhf-1.0,v1.12-debian-armhf-2,edge-debian-armhf \
v1.13/armhf/debian:v1.13.0-debian-armhf-1.0,v1.13-debian-armhf-1,edge-debian-armhf \

# Define images for running on ARM64 platforms
ARM64_IMAGES := \
v1.12/arm64/debian:v1.12.4-debian-arm64-1.0,v1.12-debian-arm64-2,edge-debian-arm64 \
v1.13/arm64/debian:v1.13.0-debian-arm64-1.0,v1.13-debian-arm64-1,edge-debian-arm64 \

WINDOWS_IMAGES := \
v1.12/windows-ltsc2019:v1.12.4-windows-ltsc2019-1.0,v1.12-windows-ltsc2019-1 \
v1.12/windows-2004:v1.12.4-windows-2004-1.0,v1.12-windows-2004-1 \
v1.12/windows-20H2:v1.12.4-windows-20H2-1.0,v1.12-windows-20H2-1
v1.13/windows-ltsc2019:v1.13.0-windows-ltsc2019-1.0,v1.13-windows-ltsc2019-1 \
v1.13/windows-2004:v1.13.0-windows-2004-1.0,v1.13-windows-2004-1 \
v1.13/windows-20H2:v1.13.0-windows-20H2-1.0,v1.13-windows-20H2-1

ALL_IMAGES := $(X86_IMAGES) $(ARM_IMAGES) $(ARM64_IMAGES) $(WINDOWS_IMAGES)

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ These tags have image version postfix. This updates many places so we need feedb

Current images use fluentd v1 series.

- `v1.12.4-1.0`, `v1.12-1`, `edge`
- `v1.13.0-1.0`, `v1.13-1`, `edge`
[(v1.12/alpine/Dockerfile)][fluentd-1-alpine]
- `v1.12.4-debian-1.0`, `v1.12-debian-1`, `edge-debian`
- `v1.13.0-debian-1.0`, `v1.13-debian-1`, `edge-debian`
[(v1.12/debian/Dockerfile)][fluentd-1-debian]
- `v1.12.4-debian-arm64-1.0`, `v1.12-debian-arm64-1`, `edge-debian-arm64`
- `v1.13.0-debian-arm64-1.0`, `v1.13-debian-arm64-1`, `edge-debian-arm64`
[(v1.12/arm64/debian/Dockerfile)][fluentd-1-debian-arm64]
- `v1.12.4-debian-armhf-1.0`, `v1.12-debian-armhf-1`, `edge-debian-armhf`
- `v1.13.0-debian-armhf-1.0`, `v1.13-debian-armhf-1`, `edge-debian-armhf`
[(v1.12/armhf/debian/Dockerfile)][fluentd-1-debian-armhf]
- `v1.12.4-windows-ltsc2019-1.0`, `v1.12-windows-ltsc2019-1`
- `v1.13.0-windows-ltsc2019-1.0`, `v1.13-windows-ltsc2019-1`
[(v1.12/windows-ltsc2019/Dockerfile)][fluentd-1-ltsc2019-windows]
- `v1.12.4-windows-2004-1.0`, `v1.12-windows-2004-1`
- `v1.13.0-windows-2004-1.0`, `v1.13-windows-2004-1`
[(v1.12/windows-2004/Dockerfile)][fluentd-1-2004-windows]
- `v1.12.4-windows-20H2-1.0`, `v1.12-windows-20H2-1`
- `v1.13.0-windows-20H2-1.0`, `v1.13-windows-20H2-1`
[(v1.12/windows-20H2/Dockerfile)][fluentd-1-20H2-windows]

### Old v1.4 images
Expand Down Expand Up @@ -224,7 +224,7 @@ To add plugins, edit `Dockerfile` as following:
#### Alpine version

```Dockerfile
FROM fluent/fluentd:v1.12-1
FROM fluent/fluentd:v1.13-1

# Use root account to use apk
USER root
Expand All @@ -247,7 +247,7 @@ USER fluent
#### Debian version

```Dockerfile
FROM fluent/fluentd:v1.12-debian-1
FROM fluent/fluentd:v1.13-debian-1

# Use root account to use apt
USER root
Expand Down
49 changes: 49 additions & 0 deletions v1.13/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

FROM alpine:3.13
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.13.0"

# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apk delete' has no effect
RUN apk update \
&& apk add --no-cache \
ca-certificates \
ruby ruby-irb ruby-etc ruby-webrick \
tini \
&& apk add --no-cache --virtual .build-deps \
build-base linux-headers \
ruby-dev gnupg \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install oj -v 3.10.18 \
&& gem install json -v 2.4.1 \
&& gem install async-http -v 0.54.0 \
&& gem install ext_monitor -v 0.1.2 \
&& gem install fluentd -v 1.13.0 \
&& gem install bigdecimal -v 1.4.4 \
&& apk del .build-deps \
&& rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem /usr/lib/ruby/gems/2.*/gems/fluentd-*/test

RUN addgroup -S fluent && adduser -S -g fluent fluent \
# for log storage (maybe shared with host)
&& mkdir -p /fluentd/log \
# configuration/plugins path (default: copied from .)
&& mkdir -p /fluentd/etc /fluentd/plugins \
&& chown -R fluent /fluentd && chgrp -R fluent /fluentd


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


ENV FLUENTD_CONF="fluent.conf"

ENV LD_PRELOAD=""
EXPOSE 24224 5140

USER fluent
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]

28 changes: 28 additions & 0 deletions v1.13/alpine/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

#source vars if file exists
DEFAULT=/etc/default/fluentd

if [ -r $DEFAULT ]; then
set -o allexport
. $DEFAULT
set +o allexport
fi

# If the user has supplied only arguments append them to `fluentd` command
if [ "${1#-}" != "$1" ]; then
set -- fluentd "$@"
fi

# If user does not supply config file or plugins, use the default
if [ "$1" = "fluentd" ]; then
if ! echo $@ | grep ' \-c' ; then
set -- "$@" -c /fluentd/etc/${FLUENTD_CONF}
fi

if ! echo $@ | grep ' \-p' ; then
set -- "$@" -p /fluentd/plugins
fi
fi

exec "$@"
33 changes: 33 additions & 0 deletions v1.13/alpine/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<source>
@type forward
@id input1
@label @mainstream
port 24224
</source>

<filter **>
@type stdout
</filter>

<label @mainstream>
<match docker.**>
@type file
@id output_docker1
path /fluentd/log/docker.*.log
symlink_path /fluentd/log/docker.log
append true
time_slice_format %Y%m%d
time_slice_wait 1m
time_format %Y%m%dT%H%M%S%z
</match>
<match **>
@type file
@id output1
path /fluentd/log/data.*.log
symlink_path /fluentd/log/data.log
append true
time_slice_format %Y%m%d
time_slice_wait 10m
time_format %Y%m%dT%H%M%S%z
</match>
</label>
15 changes: 15 additions & 0 deletions v1.13/alpine/hooks/post_push
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /post_push.erb

set -e

# Parse image name for repo name
tagStart=$(expr index "$IMAGE_NAME" :)
repoName=${IMAGE_NAME:0:tagStart-1}

# Tag and push image for each additional tag
for tag in {v1.13.0-1.0,v1.13-1,edge}; do
docker tag $IMAGE_NAME ${repoName}:${tag}
docker push ${repoName}:${tag}
done
77 changes: 77 additions & 0 deletions v1.13/arm64/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /Dockerfile.template.erb

# To set multiarch build for Docker hub automated build.
FROM golang:alpine AS builder
WORKDIR /go
ENV QEMU_DOWNLOAD_SHA256 a1ef52971537e11915565233f48aa179839f676008d7911c05b3ae94c08c4f5c
RUN apk add curl --no-cache
RUN curl -sL -o qemu-3.0.0+resin-aarch64.tar.gz https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-aarch64.tar.gz && echo "$QEMU_DOWNLOAD_SHA256 *qemu-3.0.0+resin-aarch64.tar.gz" | sha256sum -c - | tar zxvf qemu-3.0.0+resin-aarch64.tar.gz -C . && mv qemu-3.0.0+resin-aarch64/qemu-aarch64-static .

FROM arm64v8/ruby:2.6-slim-buster
COPY --from=builder /go/qemu-aarch64-static /usr/bin/
LABEL maintainer "Fluentd developers <[email protected]>"
LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.13.0"
ARG CROSS_BUILD_START="cross-build-start"
ARG CROSS_BUILD_END="cross-build-end"
RUN [ ${CROSS_BUILD_START} ]
ENV TINI_VERSION=0.18.0

# Do not split this into multiple RUN!
# Docker creates a layer for every RUN-Statement
# therefore an 'apt-get purge' has no effect
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
&& buildDeps=" \
make gcc g++ libc-dev \
wget bzip2 gnupg dirmngr \
" \
&& apt-get install -y --no-install-recommends $buildDeps \
&& echo 'gem: --no-document' >> /etc/gemrc \
&& gem install oj -v 3.10.18 \
&& gem install json -v 2.4.1 \
&& gem install async-http -v 0.54.0 \
&& gem install ext_monitor -v 0.1.2 \
&& gem install fluentd -v 1.13.0 \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/tini "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch" \
&& wget -O /usr/local/bin/tini.asc "https://github.com/krallin/tini/releases/download/v$TINI_VERSION/tini-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 6380DC428747F6C393FEACA59A84159D7001A4E5 \
&& gpg --batch --verify /usr/local/bin/tini.asc /usr/local/bin/tini \
&& rm -r /usr/local/bin/tini.asc \
&& chmod +x /usr/local/bin/tini \
&& tini -h \
&& wget -O /tmp/jemalloc-4.5.0.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/4.5.0/jemalloc-4.5.0.tar.bz2 \
&& cd /tmp && tar -xjf jemalloc-4.5.0.tar.bz2 && cd jemalloc-4.5.0/ \
&& ./configure && make \
&& mv lib/libjemalloc.so.2 /usr/lib \
&& 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 /usr/lib/ruby/gems/2.*/gems/fluentd-*/test

RUN groupadd -r fluent && useradd -r -g fluent fluent \
# for log storage (maybe shared with host)
&& mkdir -p /fluentd/log \
# configuration/plugins path (default: copied from .)
&& mkdir -p /fluentd/etc /fluentd/plugins \
&& chown -R fluent /fluentd && chgrp -R fluent /fluentd


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


ENV FLUENTD_CONF="fluent.conf"

ENV LD_PRELOAD="/usr/lib/libjemalloc.so.2"
EXPOSE 24224 5140

USER fluent
ENTRYPOINT ["tini", "--", "/bin/entrypoint.sh"]
CMD ["fluentd"]

RUN [ ${CROSS_BUILD_END} ]
28 changes: 28 additions & 0 deletions v1.13/arm64/debian/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

#source vars if file exists
DEFAULT=/etc/default/fluentd

if [ -r $DEFAULT ]; then
set -o allexport
. $DEFAULT
set +o allexport
fi

# If the user has supplied only arguments append them to `fluentd` command
if [ "${1#-}" != "$1" ]; then
set -- fluentd "$@"
fi

# If user does not supply config file or plugins, use the default
if [ "$1" = "fluentd" ]; then
if ! echo $@ | grep ' \-c' ; then
set -- "$@" -c /fluentd/etc/${FLUENTD_CONF}
fi

if ! echo $@ | grep ' \-p' ; then
set -- "$@" -p /fluentd/plugins
fi
fi

exec "$@"
33 changes: 33 additions & 0 deletions v1.13/arm64/debian/fluent.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<source>
@type forward
@id input1
@label @mainstream
port 24224
</source>

<filter **>
@type stdout
</filter>

<label @mainstream>
<match docker.**>
@type file
@id output_docker1
path /fluentd/log/docker.*.log
symlink_path /fluentd/log/docker.log
append true
time_slice_format %Y%m%d
time_slice_wait 1m
time_format %Y%m%dT%H%M%S%z
</match>
<match **>
@type file
@id output1
path /fluentd/log/data.*.log
symlink_path /fluentd/log/data.log
append true
time_slice_format %Y%m%d
time_slice_wait 10m
time_format %Y%m%dT%H%M%S%z
</match>
</label>
19 changes: 19 additions & 0 deletions v1.13/arm64/debian/hooks/post_checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash


# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /post_checkout.erb


set -e

HOST_ARCH=$(uname -m)

if [ x"${HOST_ARCH}" == x"aarch64" ]; then
echo "Building arm64 image natively"
exit
fi

# Enable cross-platform builds https://github.com/multiarch/qemu-user-static
docker run --rm --privileged multiarch/qemu-user-static:register --reset

15 changes: 15 additions & 0 deletions v1.13/arm64/debian/hooks/post_push
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
# AUTOMATICALLY GENERATED
# DO NOT EDIT THIS FILE DIRECTLY, USE /post_push.erb

set -e

# Parse image name for repo name
tagStart=$(expr index "$IMAGE_NAME" :)
repoName=${IMAGE_NAME:0:tagStart-1}

# Tag and push image for each additional tag
for tag in {v1.13.0-debian-arm64-1.0,v1.13-debian-arm64-1,edge-debian-arm64}; do
docker tag $IMAGE_NAME ${repoName}:${tag}
docker push ${repoName}:${tag}
done
Loading

0 comments on commit 43c67d1

Please sign in to comment.