Skip to content

Instantly share code, notes, and snippets.

@RamsesMartinez
Forked from evanscottgray/docker_kill.sh
Last active June 15, 2020 09:12
Show Gist options
  • Select an option

  • Save RamsesMartinez/c39cd7ad93c09a86089f11e50e74ae54 to your computer and use it in GitHub Desktop.

Select an option

Save RamsesMartinez/c39cd7ad93c09a86089f11e50e74ae54 to your computer and use it in GitHub Desktop.

Revisions

  1. RamsesMartinez revised this gist Jun 15, 2020. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions docker_kill.md
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,14 @@ stop all containers:
    docker kill $(docker ps -q)
    ```

    ```bash
    remove all containers

    ```bash
    docker rm $(docker ps -a -q)
    ```

    ```bash
    remove all docker images

    ```bash
    docker rmi $(docker images -q)
    ```
  2. RamsesMartinez revised this gist Jun 15, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker_kill.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    stop all containers:

    ```bash
    docker kill $(docker ps -q)
    docker kill $(docker ps -q)
    ```

    ```bash
  3. RamsesMartinez renamed this gist Jun 15, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion docker_kill.sh → docker_kill.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    stop all containers:
    ``bash

    ```bash
    docker kill $(docker ps -q)
    ```

  4. RamsesMartinez revised this gist Jun 15, 2020. 1 changed file with 14 additions and 1 deletion.
    15 changes: 14 additions & 1 deletion docker_kill.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1,14 @@
    docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
    stop all containers:
    ``bash
    docker kill $(docker ps -q)
    ```
    ```bash
    remove all containers
    docker rm $(docker ps -a -q)
    ```
    ```bash
    remove all docker images
    docker rmi $(docker images -q)
    ```
  5. @evanscottgray evanscottgray revised this gist Jan 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker_kill.sh
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    for line in $(docker ps | awk {' print $1 '} | tail -n+2); do docker kill $line; done
    docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt
  6. @evanscottgray evanscottgray created this gist Jan 23, 2014.
    1 change: 1 addition & 0 deletions docker_kill.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    for line in $(docker ps | awk {' print $1 '} | tail -n+2); do docker kill $line; done