Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions content/manuals/engine/cli/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,26 @@
$ docker inspect --format "{{upper .Name}}" container
```

## pad

Check warning on line 93 in content/manuals/engine/cli/formatting.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.HeadingSentenceCase] Use sentence case for headings: 'pad'. Raw Output: {"message": "[Docker.HeadingSentenceCase] Use sentence case for headings: 'pad'.", "location": {"path": "content/manuals/engine/cli/formatting.md", "range": {"start": {"line": 93, "column": 4}}}, "severity": "WARNING"}

`pad` adds whitespace padding to a string. You can specify the number of spaces to add before and after the string.

```console
$ docker image list --format '{{pad .Repository 5 10}}'
```

This example adds 5 spaces before the image repository name and 10 spaces after.

## truncate

`truncate` shortens a string to a specified length. If the string is shorter than the specified length, it remains unchanged.

```console
$ docker image list --format '{{truncate .Repository 15}}'
```

This example displays the image repository name, truncating it to the first 15 characters if it's longer.

## println

`println` prints each value on a new line.
Expand Down