Quantcast
Channel: A Portal to a Portal
Viewing all articles
Browse latest Browse all 1850

IBM Container Registry - searching and formatting

$
0
0

 So, when querying images that have been pushed to a namespace within IBM Container Registry, one can format the output to only return certain columns such as repository (image) name and tag.

Who knew ?

Well, the authors of the documentation did, apparently :-)

Formatting and filtering the CLI output

For example: -

ibmcloud cr images --format "{{ .Repository }}:{{ .Tag }}"

icr.io/hello/hello_world:1.1

icr.io/hello/hello_world:1.2

icr.io/hello/hello_world:latest

etc.

Other examples, from the doc, include: -

ibmcloud cr image-list --format "{{ if gt .Size 1000000 }}{{ .Repository }}:{{ .Tag }} {{ .SecurityStatus.Status }}{{end}}"

ibmcloud cr image-digests --format '{{if not .Tags}}{{.Repository}}@{{.Digest}}{{end}}'

ibmcloud cr image-inspect ibmliberty --format "{{ .ContainerConfig.Labels }}"

etc.

Which is nice!

*UPDATE*

And, bringing two posts together, I can report the created date AND format it from Epoch time: -

ic cr images --format "{{ .Repository }}:{{ .Tag }}:{{ .Created }}" | awk 'BEGIN { FS = ":"} ; {$3 = strftime("%c", $3)} 1'


Viewing all articles
Browse latest Browse all 1850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>