# ed machines docker rmi

> ed machines docker rmi in the Edith ed command line reference. Removes an image. Also answers to remove-image.

- Canonical URL: https://getedith.pro/docs/cli/machines-docker/rmi
- Updated: 2026-12-02

Removes an image. Also answers to `remove-image`.

```
ed machines docker rmi [--json] [--force] [--yes] <machine> <image>
```

## Arguments

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `<machine>` | machine name, ssh alias, id, or any unambiguous prefix | required | Which machine to act on. |
| `<image>` | image name, `repository:tag`, or an id from `ed machines docker images` | required | Which image to remove. |

## Options

| Name | Type / values | Default | What it does |
| --- | --- | --- | --- |
| `--json` | flag | off | Emit JSON on stdout instead of the one-line confirmation. |
| `--force` | flag | off | Remove it even when a container still refers to it. Adds `-f` to the docker command. |
| `--yes` | flag | off | Apply the removal. Without it, print the exact plan. |
| `--help`, `-h` | flag | off | Print the help for this command on stdout and exit 0. |

Human output is one line, `removed image <image>`.

## `--json` shape

```json
{
  "action": "remove docker image",
  "applied": false,
  "changed": false,
  "forced": false,
  "image": "postgres:16",
  "machine": "Devbox",
  "targets": [
    "Devbox:image:postgres:16"
  ]
}
```

`forced` records whether you passed `--force`, not whether force was needed.
`image` is echoed back as you typed it.

## Examples

```
ed machines devbox docker rmi postgres:16
ed machines devbox docker rmi de3a4eab8fdf --force --yes
ed machines devbox docker remove-image postgres:16 --json
```

## Behaviour notes

Runs `docker image rm [-f] <image>` under a 120 second ceiling after `--yes`.
Without confirmation it reports the resolved machine and image, changes
nothing, and does not connect.

Without `--force`, docker refuses to remove an image a container still refers
to, even a stopped one, and that refusal becomes exit 1 with docker's message as
the hint. With `--force` docker untags it and removes it when nothing else holds
the layers. Removing an image that several tags point at removes only the tag
you named unless you pass an id.

This is the Docker window's image delete button, which always runs the
unforced form.

## Where to go next

- [`ed machines docker`](https://getedith.pro/docs/cli/machines-docker), the rest of this group
- [All `ed` commands](https://getedith.pro/docs/cli)

## Get Edith

Edith is a native Mac app for macOS 14 or later on Apple silicon with 100+ extensions, the `ed` command line and an MCP server. $35 once for one Mac, plus $7 for each additional Mac, with no subscription and a 30-day refund.

- [Buy Edith](https://getedith.pro/pricing): $35 once for one Mac, plus $7 for each additional Mac
- [Download Edith](https://getedith.pro/download): the installer, or Homebrew
