There is a command: docker ps --format "{{.ID}}\t{{.Command}}" --no-trunc (used https://pkg.go.dev/text/template)
which outputs the full text of the '{{.Command}}' (which I need), but outputs too long '{{.ID}}'
I need to take the first 12 characters from '{{.ID}}' and all characters (--no-trunc) from '{{.Command}}'. How to do it?
You can use the ´printf` function in the Go template like this
docker ps --format "{{printf \"%.12s\" .ID}}\t{{.Command}}" --no-trunc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With