Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save thiagosperandio/1fa73a7fc8173c555f966859a6ea8379 to your computer and use it in GitHub Desktop.
Save thiagosperandio/1fa73a7fc8173c555f966859a6ea8379 to your computer and use it in GitHub Desktop.
Docker - Limpar sistema removendo itens não usados

Docker - Limpar sistema removendo itens não usados

Antes de tudo, analisar os tamanhos e usos:

  • docker system df
  • docker image ls
  • docker volume ls
  • docker ps

Limpar sistema:

  • docker system prune -a --filter label!=do-not-remove

Link: https://docs.docker.com/engine/reference/commandline/system_prune/

--

... E depois, para os malditos usuários do windows ...

Pare o Docker e vá no Power Shell pra diminuiur a VHDX, no Modo Administrador e execute:

  • Optimize-VHD -Path "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx" -Mode Quick (o nome do VHDX pode ter mudado, como por exemplo, DockerDesktop.vhdx)
@kyle-pena-nlp
Copy link

Here is an English Translation:

Docker - Clean up system by removing unused items

First of all, analyze the sizes and uses:

docker system df
docker image ls
docker volume ls
docker ps
Clear system:

docker system prune -a --filter label!=do-not-remove
Link: https://docs.docker.com/engine/reference/commandline/system_prune/

--

...
And then for the damn windows users ...

Stop Docker and go to Power Shell to slow down VHDX in Administrator Mode and run:

Optimize-VHD -Path "C:\Users\Public\Documents\Hyper-V\Virtual Hard Disks\MobyLinuxVM.vhdx" -Mode Quick (VHDX name may have changed, such as DockerDesktop.vhdx)

@thiagosperandio
Copy link
Author

Danke!

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