← All procedures

docker.run

Run a Docker container

MCPCLI
Package
@procedures/docker · README
Path
["docker","run"]
CLI
mark docker run --image <string>
MCP tool
docker.run on the dev-tools server
As data
{"$proc":["docker","run"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/docker"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["docker","run"], { image: "<image>" });
console.log(JSON.stringify(result));

From the command line

$ mark docker run --image <string>

As data, in a program

{ "$proc": ["docker", "run"], "input": { "image": "<image>" } }

Input

FieldTypeRequiredDefaultDescription
imagestringyesDocker image to run
namestringnoContainer name
portsstring[]noPort mappings (e.g., ["8080:80", "3000:3000"])
volumesstring[]noVolume mappings (e.g., ["/host:/container"])
envobjectnoEnvironment variables
detachbooleannoRun in detached mode
rmbooleannoAutomatically remove container when it exits
commandstringnoCommand to run in container
cwdstringnoWorking directory
timeoutnumbernoTimeout in milliseconds

Output

FieldTypeRequiredDefaultDescription
exitCodenumberyesThe exit code of docker (0 is success)
stdoutstringyesThe standard output of docker
stderrstringyesThe standard error of docker, or the error message when docker did not start
successbooleanyesTrue when the exit code is 0
durationnumberyesThe time of the command, in milliseconds
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "image": {
        "type": "string",
        "description": "Docker image to run"
      },
      "name": {
        "description": "Container name",
        "type": "string"
      },
      "ports": {
        "description": "Port mappings (e.g., [\"8080:80\", \"3000:3000\"])",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "volumes": {
        "description": "Volume mappings (e.g., [\"/host:/container\"])",
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "env": {
        "description": "Environment variables",
        "type": "object",
        "propertyNames": {
          "type": "string"
        },
        "additionalProperties": {
          "type": "string"
        }
      },
      "detach": {
        "description": "Run in detached mode",
        "type": "boolean"
      },
      "rm": {
        "description": "Automatically remove container when it exits",
        "type": "boolean"
      },
      "command": {
        "description": "Command to run in container",
        "type": "string"
      },
      "cwd": {
        "description": "Working directory",
        "type": "string"
      },
      "timeout": {
        "description": "Timeout in milliseconds",
        "type": "number"
      }
    },
    "required": [
      "image"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "exitCode": {
        "type": "number",
        "description": "The exit code of docker (0 is success)"
      },
      "stdout": {
        "type": "string",
        "description": "The standard output of docker"
      },
      "stderr": {
        "type": "string",
        "description": "The standard error of docker, or the error message when docker did not start"
      },
      "success": {
        "type": "boolean",
        "description": "True when the exit code is 0"
      },
      "duration": {
        "type": "number",
        "description": "The time of the command, in milliseconds"
      }
    },
    "required": [
      "exitCode",
      "stdout",
      "stderr",
      "success",
      "duration"
    ],
    "additionalProperties": {}
  }
}