Go template
A small text pattern such as {{.State.Status}} that tells a docker command which fields to print.
In more detail
Many commands take --format (often shortened to -f) to pick fields from their JSON output; {{json .Config}} prints a section as JSON. --filter, by contrast, chooses which items to list. The syntax comes from the Go programming language standard library.
Example
docker ps --format '{{.Names}} {{.Status}}'Related terms
- docker inspect — Prints everything Docker knows about a container or image as JSON: state, configuration, mounts, network settings and more.
- docker ps — Lists running containers; add -a to include stopped ones.
- JSON — A simple text format for structured data made of keys, values, lists and nested objects.
Taught in
- Docker, OCI, The Engine And The CLI — Docker Architecture & Production Containers
- Pull And Inspect A Third Party Image — Docker Architecture & Production Containers
- Run, Stop, Restart And Remove A Container — Docker Architecture & Production Containers
- Commands, Logs, Exec And Exit Codes — Docker Architecture & Production Containers
- Run The Spine Service And Publish Its Port — Docker Architecture & Production Containers
- RUN, SHELL And Efficient Layer Caching — Docker Architecture & Production Containers
- ARG, ENV, LABEL, EXPOSE And VOLUME — Docker Architecture & Production Containers
- CMD, ENTRYPOINT, USER And Process Signals — Docker Architecture & Production Containers
- Minimal Bases, Non Root Users And Smaller Images — Docker Architecture & Production Containers
- Scan, Patch And Inspect The Software Supply Chain — Docker Architecture & Production Containers
- Ephemeral Filesystems And Named Volumes — Docker Architecture & Production Containers
- Bridge Networks, DNS And Container Communication — Docker Architecture & Production Containers
- Environment, Secret Files And Runtime Restrictions — Docker Architecture & Production Containers
- Define The Service And Database With Compose — Docker Architecture & Production Containers
- Health Checks, Dependencies And Reliable Startup — Docker Architecture & Production Containers
- Integration Tests, Test Data And Compose Cleanup — Docker Architecture & Production Containers
- Diagnose Crashes, Resource Limits And Unhealthy Containers — Docker Architecture & Production Containers
- Harden And Deliver The Complete Service Stack — Docker Architecture & Production Containers