Add configurable Docker container log limits#53
Merged
Conversation
Implements Docker logging configuration to prevent excessive disk usage from container stdout/stderr logs:
- Add LogDriver, LogMaxSize, LogMaxFiles fields to DockerIsolationConfig and IsolationConfig
- BuildDockerArgs adds --log-driver and --log-opt arguments when json-file driver is configured
- Default behavior uses Docker system default (no log driver override)
- Users can explicitly set json-file driver with limits (100m max size, 3 max files by default)
- Supports both global and per-server configuration overrides
- Comprehensive test coverage for all configuration scenarios
Configuration example:
{
"docker_isolation": {
"log_driver": "json-file",
"log_max_size": "50m",
"log_max_files": "5"
}
}
…plication - Update test descriptions for clarity regarding log limits application without driver override. - Ensure log options are always applied to prevent disk space issues, even with non-json-file drivers. - Refactor BuildDockerArgs to consistently apply log size and file limits across configurations. This improves the robustness of Docker logging behavior in isolation management.
rannow
pushed a commit
to rannow/mcpproxy-go
that referenced
this pull request
Sep 23, 2025
…cker-max-logs Add configurable Docker container log limits
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements configurable Docker container log limits to prevent excessive disk usage from container stdout/stderr logs in isolated MCP servers.
LogDriver,LogMaxSize,LogMaxFilesconfiguration fields to both global and per-server isolation settingsjson-filedriver, applies log rotation limits (default: 100m max size, 3 max files)Changes
DockerIsolationConfigandIsolationConfig--log-driverand--log-optarguments based on configurationConfiguration Example
{ "docker_isolation": { "log_driver": "json-file", "log_max_size": "50m", "log_max_files": "5" }, "mcpServers": [{ "name": "special-server", "isolation": { "log_max_size": "25m", "log_max_files": "2" } }] }Test plan