docker_recreate_container
Recreate a Docker container by stopping and removing the existing one, then starting a replacement; optionally preserve its configuration and restore the original if creation fails.
Instructions
Stop and remove a container, then run a new container. With preserve_configuration, rebuild from the inspected configuration and restore the original if replacement creation fails.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "docker_recreate_container"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Container name | |
| image | No | ||
| ports | No | Container-to-host port bindings | |
| detach | No | Run container in the background | |
| labels | No | Container labels | |
| command | No | Command to run in container | |
| network | No | Network to attach the container to | |
| volumes | No | Volume mappings | |
| entrypoint | No | Entrypoint to run in container | |
| auto_remove | No | Automatically remove the container | |
| environment | No | Environment variables dictionary | |
| container_id | No | ||
| preserve_configuration | No | Rebuild from the inspected container configuration (environment, mounts/volume identity, networks, ports, labels, healthcheck, restart policy) and restore the original if replacement creation fails. Use only container_id/name and optionally image in this mode. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||