A file generator that renders templates using Docker container metadata for reverse proxy configs, log management, and service discovery.
docker-gen is a file generator that creates configuration files by processing Docker container metadata through Go templates. It solves the problem of manually managing configuration files in dynamic container environments by automatically updating files like reverse proxy settings, log rotation rules, and service discovery scripts when containers start, stop, or change.
DevOps engineers and developers running Docker containers who need dynamic configuration management for reverse proxies, logging systems, or service discovery without manual intervention.
Developers choose docker-gen because it provides a lightweight, focused solution for automating configuration file generation based on real-time container state, eliminating manual updates and enabling truly dynamic infrastructure that responds to container lifecycle events.
Generate files from docker container meta-data
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Watches Docker container events and regenerates files automatically when containers start, stop, or change, eliminating manual intervention for dynamic environments.
Uses Go's text/template language with Sprig functions and Docker-specific helpers, allowing complex logic and customization for various use cases like nginx configs or logrotate rules.
Can run on the host, bundled in a container, or as a separate container, providing versatility for integration with existing setups, as shown in the README examples.
Automatically generates nginx or HAProxy configurations based on container environment variables like VIRTUAL_HOST, simplifying traffic routing without manual proxy management.
Requires access to the Docker daemon socket, which can expose the host to vulnerabilities if not properly secured with TLS or isolation, a concern highlighted in the separate container setup notes.
Users must learn Go's templating language and Sprig functions to create or modify templates, which can be challenging for those unfamiliar with Go, despite the detailed documentation.
Only generates configuration files and doesn't handle other infrastructure aspects like service health checks or load balancing, making it a narrow tool rather than a comprehensive solution.