<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Docker on the art of simplicity</title><link>https://naoko.github.io/tags/docker/</link><description>Recent content in Docker on the art of simplicity</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 25 Aug 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://naoko.github.io/tags/docker/index.xml" rel="self" type="application/rss+xml"/><item><title>Docker Image / Container Cleaning</title><link>https://naoko.github.io/posts/2019-08-25-docker-cleaning/</link><pubDate>Sun, 25 Aug 2019 00:00:00 +0000</pubDate><guid>https://naoko.github.io/posts/2019-08-25-docker-cleaning/</guid><description>&lt;p&gt;Unused Docker image and container can quickly take up your disk spaces.&lt;/p&gt;
&lt;h3 id="lets-check-disk-usage"&gt;Let&amp;rsquo;s check disk usage&lt;/h3&gt;
&lt;p&gt;Summary of data used. You can add &lt;code&gt;-v&lt;/code&gt; flag for detailed info.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ docker system df
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;TYPE TOTAL ACTIVE SIZE RECLAIMABLE
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Images &lt;span style="color:#bd93f9"&gt;87&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;1&lt;/span&gt; 63.39GB 63.17GB &lt;span style="color:#ff79c6"&gt;(&lt;/span&gt;99%&lt;span style="color:#ff79c6"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Containers &lt;span style="color:#bd93f9"&gt;1&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt; 0B 0B
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Local Volumes &lt;span style="color:#bd93f9"&gt;69&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;1&lt;/span&gt; 2.732GB 2.683GB &lt;span style="color:#ff79c6"&gt;(&lt;/span&gt;98%&lt;span style="color:#ff79c6"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Build Cache &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt; &lt;span style="color:#bd93f9"&gt;0&lt;/span&gt; 0B 0B
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="remove-unused-data"&gt;Remove unused data&lt;/h3&gt;
&lt;p&gt;The following command will remove:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;all stopped containers&lt;/li&gt;
&lt;li&gt;all networks not used by at least one container&lt;/li&gt;
&lt;li&gt;all &lt;strong&gt;dangling images&lt;/strong&gt; (see below fo dangling images)&lt;/li&gt;
&lt;li&gt;all build cache
By default, volumes are not removed to prevent important data from being deleted.&lt;/li&gt;
&lt;/ul&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ docker system prune
WARNING! This will remove:
 - all stopped containers
 - all networks not used by at least one container
 - all dangling images
 - all dangling build cache

Are you sure you want to continue? [y/N] y
Deleted Containers:
...
Total reclaimed space: 13.91GB
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Options:&lt;/p&gt;</description></item></channel></rss>