Public | Automated Build

Last pushed: a year ago
Short Description
Docker image for Fluentd.
Full Description

docker-fluentd

This is a Docker image for Fluentd.

What is Fluentd?

Fluentd is an open source data collector, which lets you unify the data collection and consumption for a better use and understanding of data.

Hou to build this Docker image

$ docker build -t mosuka/docker-fluentd:latest .

Environment variables

Name Description
FLUENT_LOG_ROTATE_AGES Specify generations to keep rotated log files. Default is 5
FLUENT_LOG_ROTATE_SIZE Sets the byte size to rotate log files. Default is 1000000
FLUENTD_LOG_LEVEL Specify log level of Fluentd. Default is info. See Logging of Fluentd for more details
FLUENT_CONF_CONTENT Specify the content of fluent.conf
INSTALL_GEM_ARGS(_1..10) Specify the semicolon delimiter of the Gem package name and version to be installed. For example, fluent-plugin-output-solr:0.4.0

How to use this Docker image

1. Start Fluentd

$ docker run -d -p 9292:9292 -p 24224:24224/tcp -p 24224:24224/udp --name fluentd \
    --env FLUENT_LOG_ROTATE_AGES=5 \
    --env FLUENT_LOG_ROTATE_SIZE=1000000 \
    --env FLUENTD_LOG_LEVEL=info \
    --env INSTALL_GEM_ARGS_1="-f -v 0.4.0 fluent-plugin-output-solr" \
    --env INSTALL_GEM_ARGS_2="-f -v 0.5.2 fluent-plugin-filter-geoip" \
    --env FLUENT_CONF_CONTENT="$(cat fluent_file.conf)" \
    mosuka/docker-fluentd:latest
b6f25b1a787081054d24af970cf11622995b0a308c77c12c4604ce7f34522166

2. Check container ID

$ docker ps
CONTAINER ID        IMAGE                          COMMAND                  CREATED             STATUS              PORTS                                                                        NAMES
b6f25b1a7870        mosuka/docker-fluentd:latest   "/usr/local/bin/do..."   11 seconds ago      Up 6 seconds        0.0.0.0:9292->9292/tcp, 0.0.0.0:24224->24224/tcp, 0.0.0.0:24224->24224/udp   fluentd

3. Get container IP

$ FLUENTD_CONTAINER_IP=$(docker inspect -f '{{ .NetworkSettings.IPAddress }}' fluentd)
$ echo ${FLUENTD_CONTAINER_IP}
172.17.0.10

4. Get host IP and port

$ FLUENTD_HOST_IP=$(docker-machine ip default)
$ FLUENTD_HOST_IP=${FLUENTD_HOST_IP:-127.0.0.1}
$ echo ${FLUENTD_HOST_IP}
127.0.0.1

$ FLUENTD_HOST_UI_PORT=$(docker inspect -f '{{ $port := index .NetworkSettings.Ports "9292/tcp" }}{{ range $port }}{{ .HostPort }}{{ end }}' fluentd)
$ echo ${FLUENTD_HOST_UI_PORT}
9292

$ FLUENTD_HOST_PORT=$(docker inspect -f '{{ $port := index .NetworkSettings.Ports "24224/tcp" }}{{ range $port }}{{ .HostPort }}{{ end }}' fluentd)
$ echo ${FLUENTD_HOST_PORT}
24224

5. Open Fluentd UI in a browser

$ FLUENTD_DASHBOARD=http://${FLUENTD_HOST_IP}:${FLUENTD_HOST_UI_PORT}/daemon
$ echo ${FLUENTD_DASHBOARD}
http://127.0.0.1:9292/daemon

6. Stop Fluentd

$ docker stop fluentd; docker rm fluentd
fluentd
fluentd
Docker Pull Command
Owner
mosuka
Source Repository