Docker CLI Stop

Docker CLI Stop

Certified

Stop or kill a Docker container

Stops a running container by default, or kills it when kill is true, then optionally deletes it. Defaults: kill=false, delete=true.

yaml
type: io.kestra.plugin.docker.cli.Stop

Kill a Docker container by ID

yaml
id: docker_stop
namespace: company.team

tasks:
  - id: stop
    type: io.kestra.plugin.docker.cli.Stop
    containerId: 8088357a1974
    kill: true

Stop a Docker container by name

yaml
id: docker_stop_by_name
namespace: company.team

tasks:
  - id: stop
    type: io.kestra.plugin.docker.cli.Stop
    containerId: my-app
Installation

Our standard Docker images already include this plugin. If you use a -slim image or another setup, install it with the following command:

kestractl plugins get io.kestra.plugin:plugin-docker --compatible-for $KESTRA_VERSION

For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.

For Kestra CLI, replace LATEST with a specific version or version range to pin the plugin version.

Properties

Container ID or name

ID, ID prefix, or name of the container to stop or kill. For example: 8088357a1974, 8088, or my-app.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

Docker configuration file

Docker configuration file that can set access credentials to private container registries. Usually located in ~/.docker/config.json.

Credentials for a private container registry

Definitions
authstring

The registry authentication.

The auth field is a base64-encoded authentication string of username: password or a token.

identityTokenstring

The identity token.

passwordstring

The registry password.

registrystring

The registry URL.

If not defined, the registry will be extracted from the image name.

registryTokenstring

The registry token.

usernamestring

The registry username.

Defaulttrue

Delete container after stop

Defaults to true; set false to keep the container after stopping/killing.

Docker host or URI

The Docker daemon to connect to, e.g. tcp://localhost: 2375 or a Unix socket path. Defaults to the daemon available to the task runner.

Defaultfalse

Kill instead of stop

When true, sends SIGKILL; otherwise uses a graceful stop.