Containers https://cdn1.keopx.net/ es Stop and Remove all Docker containers https://cdn1.keopx.net/blog/stop-and-remove-all-docker-containers <span>Stop and Remove all Docker containers</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><h2>Stop all Docker containers</h2> <pre> <code class="language-bash">docker stop $(docker ps -a -q)</code></pre><h2>Remove not running all containers</h2> <pre> <code class="language-bash">docker ps -a | grep 'weeks ago' | awk '{print $1}' | xargs --no-run-if-empty docker rm</code></pre><h2>Delete all Volume</h2> <pre> <code class="language-bash">docker volume rm $(docker volume ls -qf dangling=true)</code></pre><h2>Delete all containers</h2> <pre> <code class="language-bash">docker rm $(docker ps -a -q)</code></pre><h2>Delete all images</h2> <pre> <code class="language-bash">docker rmi $(docker images -q)</code></pre><h2>Clean docker used space.</h2> <pre> <code class="language-bash">sudo service docker stop &amp;&amp; sudo rm -rf /var/lib/docker &amp;&amp; sudo service docker stop &amp;&amp; sudo service docker start</code></pre><p>Source:</p> <ul><li><a href="https://gist.github.com/keopx/51e37289b2088358b82b">stop_remove_docker_all.md</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2018-01-30T20:48:09+01:00" title="Martes, Enero 30, 2018 - 20:48">Mar, 30/01/2018 - 20:48</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/docker" hreflang="es">Docker</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/docker" hreflang="es">Docker</a></div> <div class="field__item"><a href="/tag/containers" hreflang="es">Containers</a></div> <div class="field__item"><a href="/tag/devops" hreflang="es">DevOps</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=296&amp;2=field_comments&amp;3=comment" token="XZVg4USyCkxZc6Q3TeHD5WUFVXaRZZ2eepogcOAMlHM"></drupal-render-placeholder> </div> </div> </section> Tue, 30 Jan 2018 19:48:09 +0000 keopx 296 at https://cdn1.keopx.net https://cdn1.keopx.net/blog/stop-and-remove-all-docker-containers#comments