Part 2: How to list Docker images programmatically in Golang

<p>In the previous article, we covered how to list Docker images, similar to the&nbsp;<code>docker images</code>&nbsp;command. In this article, our focus will be on listing images while exploring the available flag within the&nbsp;<code>docker image</code>&nbsp;command. Let&#39;s begin by examining the specific options we&#39;ll be discussing.</p> <p>In this article we will see five flags available in the Docker&nbsp;<code>images</code>&nbsp;command:</p> <ol> <li><code>-a, --all</code>: Displays all images, defaulting to true.</li> <li><code>--digest</code>: Includes image digest keys in the output.</li> <li><code>-f, --filter</code>: Filters images based on predefined criteria. For example,&nbsp;<code>docker images -f &quot;label=project&quot;</code>&nbsp;lists images with the &quot;project&quot; label.</li> </ol> <p>4.&nbsp;<code>--no-trunc</code>: Prevents the truncation of image IDs to 12 characters, as shown in the previous tutorial.</p> <p>5.&nbsp;<code>-q, --quiet</code>: Displays only image IDs.</p> <p><strong><em>Note:</em></strong><em>&nbsp;We will be discussing all flags except&nbsp;</em><code><em>--format</em></code><em>, as explaining&nbsp;</em><code><em>--format</em></code><em>&nbsp;implementation would require a lengthy explanation.</em></p> <p><a href="https://medium.com/@zs84907/part-2-how-to-list-docker-images-programmatically-in-golang-6344910b1b8f"><strong>Website</strong></a></p>
Tags: Docker Images