PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Remove all Docker Containers

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Recently I've been learning about Docker and Containers. In the process of learning this resulted in creating a bunch of containers and then shutting them all down one-by-one. And if I had 30 containers, this could take quite awhile.

Instead of wasting my time shutting them down and removing them one by one, I needed a way to stop all the containers and then remove them. If you are in need of the same functionality, simply run the following 2 commands:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

Now, if you were to run docker ps -a you will no longer see any more containers and you can start off with a clean slate :)

BETA Snippet explanation automatically generated by OpenAI:

Here is what the above code is doing:
1. It first stops all the running containers and then removes them.
2. It then removes all the stopped containers.
3. Finally it removes all the dangling images.









Snippet By Dev Dojo

ยท

Created June 12th, 2021

ยท

Report Snippet