Skip to content
Edith

Docs

Command reference

ed machines docker volume-rm

Removes a volume and everything in it. Does nothing without --yes.

Output
ed machines docker volume-rm [--json] [--yes] <machine> <volume>

Arguments

Name Type / values Default What it does
<machine> machine name, ssh alias, id, or any unambiguous prefix required Which machine to act on.
<volume> volume name, exactly as ed machines docker volumes prints it required Which volume to remove.

Options

Name Type / values Default What it does
--json flag off Emit JSON on stdout instead of the human lines.
--yes flag off Actually remove it. Without this nothing is touched.
--help, -h flag off Print the help for this command on stdout and exit 0.

Without --yes the command says what it would do and exits 0. The refusal note goes to stderr, so a script reading stdout sees only the plan:

Output
$ ed machines devbox docker volume-rm pg_datawould remove volume pg_data and everything in itnothing was removed; pass --yes to go ahead

--json shape

The same three keys in both directions. removed is the one that changes:

JSON
{  "machine": "Devbox",  "removed": false,  "volume": "pg_data"}

With --yes, and after docker agreed:

JSON
{  "machine": "Devbox",  "removed": true,  "volume": "pg_data"}
Output
ed machines devbox docker volume-rm pg_dataed machines devbox docker volume-rm pg_data --jsoned machines devbox docker volume-rm pg_data --yes

Behaviour notes

A volume is where a container keeps the data it means to survive a restart, so this is the one container operation with nothing behind it: no trash, no undo, no copy on the machine. --yes exists for that reason, and the dry run is the default rather than an option.

With --yes the remote command is docker volume rm <volume>, under a 120 second ceiling. Docker refuses to remove a volume a container still refers to, even a stopped one, and that refusal is exit 1 with docker's message as the hint; remove or recreate the container first. There is no force flag here.

The dry run is not free: ed still opens the connection and checks that docker is usable before it prints the plan, so volume-rm without --yes against an unreachable machine exits 4 rather than 0.

Where to go next