Skip to content

Instantly share code, notes, and snippets.

@faeliaso
Forked from jctosta/docker_cheatsheet.md
Created April 3, 2022 03:35
Show Gist options
  • Select an option

  • Save faeliaso/7d81122e13ee6b2530092e288e9a3ff2 to your computer and use it in GitHub Desktop.

Select an option

Save faeliaso/7d81122e13ee6b2530092e288e9a3ff2 to your computer and use it in GitHub Desktop.
Docker - Comandos Úteis

Docker - Comandos Úteis

Containers

  • Abrir um shell em um container em execução:
    • docker exec -t -i <container_id> <shell>

Limpeza

  • Excluir containers com status equivalente a Exited:
    • docker rm -v $(docker ps -a -q -f status=exited)
  • Remover imagens não utilizadas do cache local:
    • docker rmi $(docker images -f "dangling=true" -q)
  • Limpar o diretório de volumes (vsf) do docker:
    • docker run -v /var/run/docker.sock:/var/run/docker.sock -v /var/lib/docker:/var/lib/docker --rm martin/docker-cleanup-volumes
@faeliaso
Copy link
Copy Markdown
Author

faeliaso commented Apr 3, 2022

Remover geral: docker rmi $(docker images -f "dangling=false" -q)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment