Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can delete all docker containers not used? #57

Open
johnfelipe opened this issue Jun 21, 2022 · 2 comments
Open

how can delete all docker containers not used? #57

johnfelipe opened this issue Jun 21, 2022 · 2 comments

Comments

@johnfelipe
Copy link

docker rm bb2afb1ec924
docker rm 26b7e3c4e010
docker rm 6932e19f8031
docker rm fb72d73d1675
docker rm 9a658133ced9

this not good workflow each time for review cassandra avaible or not have a contanier

root@ubuntu20dockers:~/Dockerfiles/nagios-plugins-cassandra# docker ps -a
CONTAINER ID   IMAGE                                 COMMAND                  CREATED             STATUS                         PORTS     NAMES
26b7e3c4e010   harisekhon/nagios-plugins             "find_active_cassand…"   33 seconds ago      Exited (1) 31 seconds ago                beautiful_fermat
6932e19f8031   harisekhon/nagios-plugins             "find_active_cassand…"   2 minutes ago       Exited (3) 2 minutes ago                 quizzical_nightingale
fb72d73d1675   harisekhon/nagios-plugins             "find_active_cassand…"   4 minutes ago       Exited (3) 4 minutes ago                 blissful_perlman
bb2afb1ec924   harisekhon/nagios-plugins             "find_active_cassand…"   4 minutes ago       Exited (0) 4 minutes ago                 sleepy_darwin
9a658133ced9   harisekhon/nagios-plugins             "find_active_cassand…"   10 minutes ago      Exited (3) 10 minutes ago                suspicious_stonebraker
a623dd501d39   harisekhon/nagios-plugins             "check_zaloni_bedroc…"   29 minutes ago      Exited (3) 29 minutes ago                musing_neumann
566ce41b26e3   harisekhon/nagios-plugins:cassandra   "check_zaloni_bedroc…"   31 minutes ago      Exited (4) 31 minutes ago                pedantic_maxwell
812501ccb4b3   harisekhon/nagios-plugins:cassandra   "check_zaloni_bedroc…"   38 minutes ago      Exited (4) 38 minutes ago                wonderful_kepler
d5de82e52415   harisekhon/nagios-plugins:cassandra   "/bin/bash -c 'find …"   43 minutes ago      Exited (0) 43 minutes ago                vigorous_kalam
2d98bcbfeec7   harisekhon/cassandra-dev:latest       "/bin/sh -c /entrypo…"   46 minutes ago      Exited (137) 35 seconds ago              cassandra-dev_cassandra_1
86d472f28229   harisekhon/nagios-plugins             "check_ssl_cert.pl -V"   47 minutes ago      Exited (3) 47 minutes ago                compassionate_chatelet
69f03cedcf49   harisekhon/nagios-plugins             "check_ssl_cert.pl -…"   49 minutes ago      Exited (3) 49 minutes ago                interesting_jackson
878cb6c2a5a8   harisekhon/nagios-plugins             "/list_plugins.sh"       49 minutes ago      Exited (0) 49 minutes ago                sleepy_burnell
a66982209491   harisekhon/pytools                    "dockerhub_search.py…"   49 minutes ago      Exited (4) 49 minutes ago                peaceful_galois
50571f96794a   jasonrivers/nagios:latest             "/usr/local/bin/star…"   About an hour ago   Exited (4) About an hour ago             nagios4

for delete container

root@ubuntu20dockers:~/Dockerfiles/nagios-plugins-cassandra# docker rm 26b7e3c4e010
26b7e3c4e010
root@ubuntu20dockers:~/Dockerfiles/nagios-plugins-cassandra# docker rm 6932e19f8031
6932e19f8031
root@ubuntu20dockers:~/Dockerfiles/nagios-plugins-cassandra# docker rm fb72d73d1675
fb72d73d1675
root@ubuntu20dockers:~/Dockerfiles/nagios-plugins-cassandra# docker rm 9a658133ced9
9a658133ced9

@devarsh10
Copy link

Hey @johnfelipe,
You can delete all unused containers from Docker Desktop[Software]. Instead of using docker rm {id_1} {id_2}....

Regards.

@HariSekhon
Copy link
Owner

docker rm -f -- $(docker ps -a --format "{{.ID}}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants