-
Notifications
You must be signed in to change notification settings - Fork 4
CLI Machines Docker Prune
Reclaims space by removing unused docker objects. Does nothing without --yes.
ed machines docker prune [--json] [--yes] <machine> [<what>]
| Name | Type / values | Default | What it does |
|---|---|---|---|
<machine> |
machine name, ssh alias, id, or any unambiguous prefix | required | Which machine to act on. |
<what> |
images, volumes, networks, builder or system
|
system |
Which family of unused objects to remove. |
| Name | Type / values | Default | What it does |
|---|---|---|---|
--json |
flag | off | Emit JSON on stdout instead of the human lines. |
--yes |
flag | off | Actually prune. Without it nothing is removed. |
--help, -h
|
flag | off | Print the help for this command on stdout and exit 0. |
Each target maps to exactly one docker command, and the dry run prints it:
<what> |
Command | What goes |
|---|---|---|
images |
docker image prune -af |
Every image no container uses, not just the dangling ones. |
volumes |
docker volume prune -f |
Every volume no container uses, and the data in it. |
networks |
docker network prune -f |
Every user-defined network nothing is attached to. |
builder |
docker builder prune -af |
The whole build cache. |
system |
docker system prune -f |
Stopped containers, unused networks, dangling images and build cache. Volumes are not included. |
$ ed machines tuf docker prune
would run: docker system prune -f
pass --yes to do it
The two shapes differ, which is worth knowing before you parse them. The dry run reports the command it would have run:
{
"applied": false,
"command": "docker image prune -af",
"machine": "Asus TUF 7",
"target": "images"
}The applied run reports what docker said instead:
{
"applied": true,
"machine": "Asus TUF 7",
"output": "Total reclaimed space: 3.585GB",
"target": "images"
}command is present only when applied is false, and output only when it is
true. output is docker's stdout with leading and trailing whitespace trimmed,
which for a real prune is a list of deleted ids followed by the reclaimed total.
Without --json that same stdout is printed raw.
ed machines tuf docker prune
ed machines tuf docker prune images --json
ed machines tuf docker prune builder --yes
ed machines tuf docker prune volumes --yes
The target is checked before anything else happens, including before the connection is opened, so a typo costs nothing and exits 3 with the valid list:
$ ed machines tuf docker prune everything
error: docker cannot prune everything
hint: try: images, volumes, networks, builder, system
volumes is spelled out as its own target rather than folded into system on
purpose. docker system prune does not touch volumes unless it is asked to, and
ed never asks it to, so the only way to lose volume data here is to type
prune volumes --yes.
prune images is more aggressive than docker image prune typed by hand. The
-a means every image without a container, not only the untagged ones, so a
tagged image you pulled for later goes too. Check
ed machines docker df --json first: the Images row's reclaimableBytes is
what this will free.
With --yes the ceiling is 300 seconds, longer than any container verb here and
second only to compose pull. A prune that outruns it is reported as a failure
while docker keeps going on the machine.
-
ed machines docker, the rest of this group - All
edcommands
Auto-generated from docs/, edit the docs in the repo, not the wiki.
CLI reference
Companion
- Deploy
- Concepts
- Concepts Memory
- Concepts Ingestion
- Concepts Search
- Concepts Chat
- Concepts Learning
- Concepts Brain
- Concepts Friend
- Hosts
- Stack
- Status
- Doctor
- Search
- Index
- Ingest
- Episodes
- Sync
- Observations
- Reflect
- Beliefs
- Ask
- Extract
- Claims
- Corroborate
- Runs
- Chat
- Conversations
- Forget
- Export
- Import
- Erase
- Wipe
- Episode
- Nightly
- Reason
- Personas
- Council
- Lenses
- Core
- Why
- Hypotheses
- Predictions
- Commitments
- Discrepancies
- Calibration
- Inquire
- Entities
- Eval
- Standup
- Machines
- Baselines
- Connectors
- Facts
- Correct
- Weekly
- Db
Guides