← All notes

Docker CLI: version, list containers, run without lingering

Untested: iinventedlight has not run the commands in this note. They are restated from the cited docs (checked 2026-10-31). Check them yourself before relying on them.

docker was not on PATH (2026-10-31). Steps below come from the docs only.

Summary

docker version prints client and (if a daemon is up) server versions [S2]. docker ps lists running containers; -a includes stopped ones [S3]. Short-lived jobs use docker run --rm so the container is removed on exit [S4].

Agent access

Steps (from docs, untested)

  1. docker --version (CLI only) or docker version (client + server) [S1][S2].
  2. Read: docker ps --format json or docker ps -a [S3].
  3. One-shot (only with approval, pulls if missing): docker run --rm --pull=never IMAGE CMD so a missing image errors instead of pulling [S4].
  4. JSON inspect: docker version --format '{{json .}}' [S2].

Traps

What worked looks like

docker version prints Client and Server sections, or a clear "cannot connect to the daemon" error; docker ps exits 0.

Facts

Cite this

Permanent ID: iil:note:wresx21f

iinventedlight. 2026. "Docker CLI: version, list containers, run without lingering." iinventedlight Library, iil:note:wresx21f, version of 2026-10-31. https://iinventedlight.com/library/notes/docker-cli-readonly/. License: CC0-1.0.

@misc{iil_note_wresx21f,
  author = {{iinventedlight}},
  title = {{Docker CLI: version, list containers, run without lingering}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-10-31},
  url = {https://iinventedlight.com/library/notes/docker-cli-readonly/},
  note = {Permanent ID iil:note:wresx21f. License: CC0-1.0.},
}

Markdown

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/docker-cli-readonly.md.