Skip to content
Français

removeDockerSandbox

import { removeDockerSandbox } from "@elie-laloum/outpost/providers/docker";

Remove a Docker sandbox and its egress companion by name, whatever the repositoryMode of the provider that created it. Containers already gone are ignored, so repeating the call succeeds. A name other than outpost-<uuid> is refused with code configuration before any docker command. The container is removed even while a lease still uses it; that lease’s later commands fail and its release remains safe.

Complete example and detailed rules.

  • nameRequired
    string
    Sandbox name, as reported by listDockerSandboxes or received by SandboxContext.registerRecovery.
  • optionsOptional
    TransferOptions | undefined
    Cancellation signal and deadline applied to each docker command of the removal.
  • options.signalOptional
    AbortSignal | undefined
    Cooperative cancellation of the removal; aborting stops the running docker command and rejects.
  • options.deadlineMsOptional
    number | undefined
    Maximum duration in milliseconds of each docker command of the removal, default 10000; past it the removal rejects with code timeout.

Promise<void>

export declare const removeDockerSandbox: (
  name: string,
  options?: TransferOptions,
) => Promise<void>;