Join our Discord Server
Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Distinguished Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 700+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 9800+ members and discord server close to 2600+ members. You can follow him on Twitter(@ajeetsraina).

How to change the default Disk Image Installation directory in Docker Desktop for Windows

1 min read

Docker Desktop is a powerful tool that allows developers to build, ship, and run applications in containers. By default, Docker stores its images and containers in the system drive, which can sometimes lead to storage space issues. In this blog post, we’ll explore how to change the Docker image installation directory on the Windows platform.

Tested System:

  • Lenovo ThinkPad X1
  • Microsoft Windows 11 Pro
  • 32 GB RAM
  • 13th Gen Intel Core i7-1355U

Pre-requisite:

  1. Ensure that you have installed the latest version of Docker Desktop for Windows 4.26.1.
Image1

2. Ensure that “Use the WSL2 based engine” is enabled under Dashboard > Settings > General.

Image2

3. Open Settings > Resources > WSL Integration option.

As shown, the current default Docker Image location is C:\Users\ajeet\AppData\Local\Docker\wsl.

Image3 embed

Changing the Installation Directory

Go ahead and try changing the default Disk Image location.

Image5

Quick Note: The Resource section also allows you to configure limits on the memory, CPU and Swap size allocated to WSL2 by editing the .wslconfig file.

The wsl.conf and .wslconfig files are used to configure advanced settings options, on a per-distribution basis (wsl.conf) and globally across all WSL 2 distributions (.wslconfig). This guide will cover each of the settings options, when to use each file type, where to store the file, sample settings files and tips.

What is the difference between wsl.conf and .wslconfig?

You can configure the settings for your installed Linux distributions that will automatically be applied every time you launch WSL in two ways, by using:

  • .wslconfig to configure global settings across all installed distributions running on WSL 2.
  • wsl.conf to configure local settings per-distribution for each Linux distribution running on WSL 1 or WSL 2.

Both file types are used for configuring WSL settings, but the location where the file is stored, the scope of the configuration, the type of options that can be configured, and the version of WSL running your distribution all impact which file type to choose.

WSL 1 and WSL 2 run with different architecture and will impact the configuration settings. WSL 2 runs as a lightweight virtual machine (VM), so uses virtualization settings that allow you to control the amount of memory or processors used (which may be familiar if you use Hyper-V or VirtualBox). Check which version of WSL you are running.

Configuring which WSL 2 distros you want to access Docker from

You can “Enable integration with my default WSL distro” under Resources > WSL Integration option.

Image description

Conclusion

Changing the Docker image installation directory on Windows is a straightforward process. By selecting a different location with more available space, you can avoid running into storage issues when working with containers.

Remember to be cautious when modifying Docker settings, and always ensure that you have adequate disk space on the chosen drive. Happy containerizing!

Keep Reading

  • Testcontainers and Playwright

    Testcontainers and Playwright

    Discover how Testcontainers-Playwright simplifies browser automation and testing without local Playwright installations. Learn about its features, limitations, compatibility, and usage with code examples.

    Read More

  • Getting Started with the Low-Cost RPLIDAR Using NVIDIA Jetson Nano

    Getting Started with the Low-Cost RPLIDAR Using NVIDIA Jetson Nano

    Conclusion Getting started with low-code RPlidar with Jetson Nano is an exciting journey that can open up a wide range of possibilities for building robotics projects. In this blog post, we covered the basic steps to get started with low-code RPlidar with Jetson Nano, including setting up ROS, installing the RPlidar driver and viewing RPlidar…

    Read More

  • Docker and Wasm Containers – Better Together

    Docker and Wasm Containers – Better Together

    Learn how Docker Desktop and CLI both manages Linux containers and Wasm containers side by side.

    Read More

  • Tesla Model 3 Report: An In-Depth Analysis by CrewAI Maintenance Specialist Agent

    Tesla Model 3 Report: An In-Depth Analysis by CrewAI Maintenance Specialist Agent

    T Tesla Model 3 Report: An Expert Maintenance Perspective Welcome to our in-depth blog post where CrewAI, acting as your dedicated maintenance specialist, provides a comprehensive report on the Tesla Model 3. In this post, we cover everything from the executive summary and detailed specifications to pricing, maintenance insights, and performance metrics. The final report…

    Read More

  • YouTube Transcript Generator Using Model Context Protocol in Just 5 Lines of Code

    YouTube Transcript Generator Using Model Context Protocol in Just 5 Lines of Code

    Ever wanted to get the transcript of a YouTube video without subscribing to expensive services or wrestling with complicated APIs? In this blog post, I’ll show you how to build a YouTube transcript generator using the Model Context Protocol (MCP) in just 5 lines of code, based on the excellent mcp-server-youtube-transcript project. What is Model…

    Read More

  • What problem does CrewAI solve?: Unleashing the Power of CrewAI

    What problem does CrewAI solve?: Unleashing the Power of CrewAI

    Revolutionizing AI Automation: Unleashing the Power of CrewAI In this blog today, let us discover how CrewAI – a fast, flexible, and standalone multi-agent automation framework – is transforming the way developers build intelligent, autonomous AI agents for any scenario. What is CrewAI? CrewAI is a lean, lightning-fast Python framework built entirely from scratch—completely independent…

    Read More

Have Queries? Join https://launchpass.com/collabnix

Ajeet Raina Ajeet Singh Raina is a former Docker Captain, Community Leader and Distinguished Arm Ambassador. He is a founder of Collabnix blogging site and has authored more than 700+ blogs on Docker, Kubernetes and Cloud-Native Technology. He runs a community Slack of 9800+ members and discord server close to 2600+ members. You can follow him on Twitter(@ajeetsraina).
Collabnixx
Chatbot
Join our Discord Server
Index