Dot Peekser Logo

#orphan-layers#windows-docker#docker-cleanup

How to remove orphan layers in docker for windows

by Fabian Holtermann on

Discover how to effectively address the issue of orphan layers in Docker, which can cause file system congestion and resist manual deletion. This concise guide presents a solution to safely remove these lingering layers.

  • Orphan layers left by Docker can clutter the file system, posing deletion challenges.
  • Manual deletion of these layers risks potential damage to the Docker environment.
  • The command docker system prune -a fails to resolve this specific issue.

Thanks to Olli Janatuinen's discovery, a reliable solution has been found.

TL;DR

  1. Execute the script Find-OrphanDockerLayers.ps1 -RenameOrphanLayers.
  2. Make sure that you have your path variables in place:
    C:\Program Files\Docker\Docker\resources
  3. Initiate a Docker daemon with extended shutdown timeout.
    dockerd -D --shutdown-timeout 900
  4. Stop the daemon using "CTRL+C" to trigger the removal of all dangling layers.

Original Post

To access the detailed original post on GitHub, visit: https://github.com/docker/for-win/issues/745#issuecomment-445243539

Attachments

Fabian Holtermann

For over 14 years, I've been dedicated to crafting web experiences that make a real impact. I thrive on continuously improving my skills and embracing new challenges that come my way.