Skip to content

Comments

Add resource limits support to container run command#1473

Merged
ayalcin-mw merged 1 commit intomasterfrom
feat/container-limits
Nov 3, 2025
Merged

Add resource limits support to container run command#1473
ayalcin-mw merged 1 commit intomasterfrom
feat/container-limits

Conversation

@martin-helmich
Copy link
Member

Summary

This PR enables users to control CPU and memory consumption for containers created with mw container run, bringing the CLI to feature parity with Docker's resource management capabilities.

Benefits

Resource Control: Users can now prevent containers from consuming excessive CPU or memory resources on their hosting environment, ensuring predictable performance and preventing resource starvation for other services.

Docker Compatibility: The implementation uses the same flag names (--cpus and --memory) as Docker, making it intuitive for users familiar with Docker workflows. The underlying data structure follows docker-compose conventions (deploy.resources.limits), enabling seamless migration of existing compose files.

Improved Stability: Resource limits help prevent runaway processes from impacting other containers or the host system, improving overall system stability.

Usage

# Limit container to 1 CPU and 512MB memory
mw container run --cpus 1 --memory 512m nginx

# Short form for memory
mw container run -m 1g myapp

🤖 Generated with Claude Code

Adds --cpus and --memory flags to enable resource limit configuration similar to docker run, improving compatibility with docker-compose workflows where deploy.resources.limits is commonly used.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants