0

TL;DR: Can I configure where to install the docker container in windows 10 home?

I installed Docker on WSL2 backend. However I could not find any options to change container installation path. So I tried installing nonetheless,

docker pull carlasim/carla:0.8.2

installation could not finish because of no space left in C drive. Currently the downloaded data resides in:

C:\Users\Username\AppData\Local\Docker\wsl\data

however I could not delete it. After quitting docker desktop I could delete it.

OsmanBerk
  • 33
  • 1
  • 5
  • Refer to https://stackoverflow.com/questions/62441307/how-can-i-change-the-location-of-docker-images-when-using-docker-desktop-on-wsl2/63752264#63752264 – KwongTN May 15 '21 at 15:18

1 Answers1

1

Looks like you're talking about images, not containers, and yes, it's entirely possible.

you need to find or create the daemon.json, located at:

  • Windows : C:\ProgramData\docker\config\daemon.json
  • Linux : /etc/docker/daemon.json

and have it include "data-root": "folder/path"

it'll look like this

{
 "data-root": "/mnt/path/to/images/folder"
}

or

{
 "data-root": "E:\path\to\docker\images\folder"
}

Docker daemon docs

PowerShellGuy
  • 733
  • 2
  • 8
  • This works only when using Windows containers in windows 10 – H_H Dec 28 '21 at 11:01
  • `"data-root": "E:\path\to\docker\images\folder"` did not work for me (Windows Server 2022) - I had to use double-backslashes like `"data-root": "E:\\path\\to\\docker\\images\\folder"` or regular-slashes `"data-root": "E:/path/to/docker/images/folder"` – Morten Jensen Jan 24 '22 at 12:34
  • 1
    For some reason when i include data-root in the daemon.json docker engine fails to start – Raul Chiarella Sep 11 '22 at 19:53
  • Same. Docker completely breaks if `data-root` is there (at least on Windows, and the latest version as of this date) – Kobato Nov 24 '22 at 01:03