Skip to content

Instantly share code, notes, and snippets.

@HDias
Last active February 24, 2023 14:54
Show Gist options
  • Save HDias/1d3e5ab3f34a8c5ea9cfd448f57f7ed7 to your computer and use it in GitHub Desktop.
Save HDias/1d3e5ab3f34a8c5ea9cfd448f57f7ed7 to your computer and use it in GitHub Desktop.

Revisions

  1. HDias revised this gist Feb 24, 2023. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions docker-rm.sh
    Original file line number Diff line number Diff line change
    @@ -4,3 +4,6 @@ docker rm $(docker ps -a -f status=exited -q)
    # remove unused images
    docker rmi $(docker images -f dangling=true -q)

    # get IP from container
    docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

  2. HDias renamed this gist Oct 29, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. HDias created this gist Oct 29, 2022.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    # remove containers exited
    docker rm $(docker ps -a -f status=exited -q)

    # remove unused images
    docker rmi $(docker images -f dangling=true -q)