Fluentd Docker image with extra installed plugins
1.7K
Automated Docker images for Fluentd with pre-installed plugins, multi-architecture support, and weekly upstream synchronization.
This repository provides customized Fluentd Docker images based on the official fluent/fluentd-docker-image upstream. The images include essential plugins for log aggregation and are automatically built for multiple architectures.
Key Features:
Docker Hub: kiennt26/fluentd
This repository uses a patch-based approach to customize upstream Dockerfiles:
fluent/fluentd-docker-image repositoryThe system automatically checks for upstream changes every Sunday at midnight UTC:
Dockerfile.template.erb.last-upstream-sync fileThe following plugins are pre-installed in all images:
| Plugin | Version | Purpose |
|---|---|---|
| fluent-plugin-elasticsearch | 6.0.0 | Output to Elasticsearch |
| fluent-plugin-grok-parser | 2.6.2 | Parse unstructured logs with Grok patterns |
| fluent-plugin-prometheus | 2.2.2 | Export metrics to Prometheus |
| fluent-plugin-rewrite-tag-filter | 2.4.0 | Dynamically rewrite tags based on conditions |
| fluent-plugin-record-modifier | 2.2.1 | Modify record fields |
To modify the plugin list:
Edit plugins.txt:
# Format: plugin-name -v version
fluent-plugin-elasticsearch -v 6.0.0
fluent-plugin-grok-parser -v 2.6.2
# Add your new plugin here
Update the generation script (scripts/generate.sh):
awk command around line 79-86 to include your new pluginprint " && gem install your-new-plugin \\"Regenerate Dockerfiles:
make generate VERSION=1.17 ARCH=debian
Update verification script (scripts/verify.sh):
PLUGINS array (line 11-17)Commit and push to trigger the build workflow
All plugins are pinned to specific versions to ensure reproducible builds. When updating plugins:
plugins.txtThe Makefile provides convenient targets for local development:
Generate Dockerfiles from upstream with custom patches:
# Generate for specific version and architecture
make generate VERSION=1.17 ARCH=debian
# Generate for all combinations (manual)
for version in 1.17 1.18 1.19; do
for arch in debian arm64 armhf; do
make generate VERSION=$version ARCH=$arch
done
done
Build Docker images for testing:
# Build specific version/architecture
make build VERSION=1.17 ARCH=debian
# This builds: kiennt26/fluentd:1.17-debian
Run verification tests on built images:
# Verify specific image
make verify VERSION=1.17 ARCH=debian
# Tests include:
# - Fluentd process running
# - All plugins installed
Remove all generated Dockerfiles:
make clean
Display all available targets:
make help
You can also use scripts directly:
# Generate Dockerfile
./scripts/generate.sh 1.17 debian
# Check for upstream changes
./scripts/check-upstream.sh
# Verify image
./scripts/verify.sh kiennt26/fluentd:v1.17-debian-1.0
After building an image:
# Run container
docker run -it --rm kiennt26/fluentd:1.17-debian
# Check installed plugins
docker run --rm kiennt26/fluentd:1.17-debian fluent-gem list | grep fluent-plugin
# Verify Fluentd version
docker run --rm kiennt26/fluentd:1.17-debian fluentd --version
.github/workflows/sync-fluentd.yml)Trigger: Weekly (Sunday 00:00 UTC) or manual dispatch
Process:
check-upstream.sh.last-upstream-sync with latest commit SHAOutput: Pull request labeled automated, sync
.github/workflows/build-fluentd.yml)Trigger:
main branch (changes in fluentd/ directory)main (changes in fluentd/ directory)Process:
Tags: kiennt26/fluentd:v{version}-{arch}-1.0
Platforms: linux/amd64, linux/arm64, linux/arm/v7
Configure these secrets in your GitHub repository settings:
DOCKERHUB_USERNAME - Docker Hub usernameDOCKERHUB_PASSWORD - Docker Hub password or access tokenProblem: The upstream repository structure has changed.
Solution:
# Manually clone upstream to check structure
git clone https://github.com/fluent/fluentd-docker-image.git /tmp/fluentd-docker-image
ls -la /tmp/fluentd-docker-image/v1.17/
# Update the path in scripts/generate.sh if needed
Problem: Plugin version incompatible with Fluentd version.
Solution:
plugins.txtgem install fluent-plugin-name -v version locallyProblem: Plugin installation failed during build.
Solution:
# Check build logs for gem installation errors
# Test plugin installation manually
docker run --rm kiennt26/fluentd:1.17-debian fluent-gem install fluent-plugin-name
# Check if plugin conflicts with others
docker run --rm kiennt26/fluentd:1.17-debian fluent-gem list
Problem: QEMU or Buildx not properly configured.
Solution:
# Ensure QEMU is installed
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# Check Buildx is available
docker buildx version
# Inspect builder
docker buildx inspect
Problem: Upstream check returns "unchanged" incorrectly.
Solution:
# Check .last-upstream-sync file
cat fluentd/.last-upstream-sync
# Manually run check script
cd fluentd
./scripts/check-upstream.sh
# Force sync by removing the file
rm fluentd/.last-upstream-sync
git commit -am "Force upstream sync"
Problem: Authentication or rate limiting issues.
Solution:
DOCKERHUB_USERNAME and DOCKERHUB_PASSWORD secretsdocker run --rm quay.io/skopeo/stable docker://kiennt26/fluentdEnable verbose output for debugging:
# Generate with bash debug mode
bash -x ./scripts/generate.sh 1.17 debian
# Check upstream with debug
bash -x ./scripts/check-upstream.sh
# Verify with debug
bash -x ./scripts/verify.sh kiennt26/fluentd:v1.17-debian-1.0
If you encounter issues not covered here:
Contributions are welcome! Please:
make verifyThis repository follows the same license as the upstream fluent/fluentd-docker-image project.
Content type
Image
Digest
Size
16.3 MB
Last updated
about 6 years ago
docker pull kiennt26/fluentd