Permanently remove a managed devcontainer, its named Docker volumes, and any staged remote project files, behind an explicit confirmation step.
pks devcontainer destroy [CONTAINER_ID] [options]$ pks devcontainer destroyPick a container and remove it after confirmation
$ pks devcontainer destroy 3f2a1bDestroy a container by ID prefix
$ pks devcontainer destroy --forceSkip the confirmation prompt
pks devcontainer destroy removes a managed devcontainer and the named Docker volumes mounted into it. On a remote host it also deletes the staged copy of the project files under /tmp/pks-devcontainer/{project}.
This is irreversible. Anything that exists only inside the container's volume — including edits made live inside a running container — is gone once the volume is removed.
pks devcontainer destroy [CONTAINER_ID] [options]
CONTAINER_ID is optional and matches on prefix. Without it, the command shows a selection list.
pks devcontainer destroy
The command discovers the container's mounted volumes and prints a confirmation listing every container, volume, and file path it is about to remove. Read that list before answering. On confirmation the container is force-removed and each named volume is deleted.
Target one directly by ID prefix:
pks devcontainer destroy 3f2a1b
Skip the prompt in an automated cleanup, once you are certain of the target:
pks devcontainer destroy 3f2a1b --force
pks devcontainer list --all
The destroyed container no longer appears, including among stopped containers.
| Flag | Default | Description |
|---|---|---|
-f|--force | false | Skip the confirmation prompt and destroy immediately. |
-o|--output-path <PATH> | — | Inherited. Not read by this command. |
-v|--verbose | false | Inherited. Not read by this command. |
--dry-run | false | Inherited. Not read by this command, and there is no preview mode. |
Work disappeared after a destroy. Every named volume mounted into the container is removed along with it. Files that lived only in the volume, such as edits made inside a running container that were never synced to the host, cannot be recovered. Commit and push from inside the container before destroying it.
--dry-run shows no preview. The option is inherited from the shared settings base and has no effect here. The confirmation prompt is the only place the removal targets are listed, so run without --force to see them.
The command asks Which host? first. When SSH targets are registered, the host picker runs before the container selection list. There is no flag to preselect a host for destroy, so this step is interactive on machines with registered targets.
A volume survives the destroy. Only volumes mounted into the container at the time of removal are discovered. A volume created for a container that no longer exists must be removed with Docker directly.