container_create
Create a Docker container from an image without starting it, allowing configuration before the first start. Use to separate creation and start steps.
Instructions
Create a container from an image without starting it.
Use this when you need to configure a container (with extra_kwargs) before its first
start, or want creation and start as separate observable steps. For the common case of
create-then-start-immediately use container_run instead — it does both in one call.
Start the created container with container_start. Common extra_kwargs keys: name
(str), environment (list of "KEY=VAL" or dict), ports (dict, e.g.
{"80/tcp": 8080}), volumes (dict, e.g. {"/host/path": {"bind": "/container/path", "mode": "rw"}}), labels (dict). For anything else docker-py's ContainerCollection.create
accepts, call docs_lookup(section="containers") rather than guessing a key name.
args: image - Image to create the container from, e.g. "nginx:alpine" command - Override the image's default command; string or list of strings extra_kwargs - Additional docker-py ContainerCollection.create keyword arguments returns: dict - The created container's attrs (not yet running)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| image | Yes | ||
| command | No | ||
| extra_kwargs | No |