From 059593c865c33c9e197b42a53194245f15c61d9d Mon Sep 17 00:00:00 2001 From: Simon Heimberg Date: Tue, 13 Nov 2018 08:55:42 +0100 Subject: [PATCH 1/2] Show hint how to find out what data can be printed This hint is unnecessary for inspect commands since this is the default. But for other commands, I regularly find out again this trick. --- config/formatting.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/formatting.md b/config/formatting.md index d869250112..0810c874b3 100644 --- a/config/formatting.md +++ b/config/formatting.md @@ -87,3 +87,10 @@ docker inspect --format "{{upper .Name}}" container docker inspect --format='{{range .NetworkSettings.Networks}}{{println .IPAddress}}{{end}}' container ``` {% endraw %} + +# Hint + +To find out what data can be printed, show all content as json: +``` +docker container ls --format='{{json .}}' +``` From 643954e77e3b692d24a85cd9081359dbccf5515e Mon Sep 17 00:00:00 2001 From: Anne Henmi <41210220+ahh-docker@users.noreply.github.com> Date: Wed, 26 Dec 2018 09:50:25 -0700 Subject: [PATCH 2/2] Update formatting.md --- config/formatting.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/formatting.md b/config/formatting.md index 0810c874b3..e916e845ba 100644 --- a/config/formatting.md +++ b/config/formatting.md @@ -91,6 +91,9 @@ docker inspect --format='{{range .NetworkSettings.Networks}}{{println .IPAddress # Hint To find out what data can be printed, show all content as json: + +{% raw %} ``` docker container ls --format='{{json .}}' ``` +{% endraw %}