Docker Stop

Docker 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: run
    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
Properties

Docker configuration file

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

Container ID or name

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

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.

The URI of your Docker host e.g. localhost

Defaultfalse

Kill instead of stop

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

Reference (ref) of the pluginDefaults to apply to this task.