-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Provide option to store images/containers/volumes on other drives #239
Comments
Here is a band aid solution to select the folders |
Thanks for submitting your issue, we are not working on this right now but we might in future. |
There is a field in the Settings to set the location of the data folder, for Mac and Windows Hyper-V. |
We have added a similar field in the settings for the WSL 2 data, this will be available in Docker Desktop 4.17. |
For me worked this solution: For windows containers (I didn't have any image or volume yet.)
After that, I can see that the image is on disk D For linux containers I moved the wsl distribution docker-desktop-data
|
Hey @mat007 , can we close this now ? |
Can we please have an extension to dockerfile The requested destination directive should be a "weak" one, so when the target folder/drive doesn't exist, the image/container shall be downloaded to the default location and a warning should be output. |
@christophermclellan IMO this should not be closed because this feature still does not actually work. See docker/for-win#13269. |
In my opinion, using a single file for containers and images is not a good solution. There should be a possibility to use different locations on different drives. Moving everything into slow HDD is not good solution. |
I'm not sure if this is a Windows peculiarity, so I first posted my feature request to the Docker for Windows issues list.
Professional Windows users tend to have more than just a single hard drive in their machines, using the second (and further) drives to store their data, while reserving the first drive (the so-called "C:" drive) for Windows and program installation (i. e., things that can easily be restored when Windows becomes inaccessible due to misconfiguration, hardware failure or whatever).
Docker currently
lacks the ability to assign a mount point for images, containers and volumes.
At this time, my system disk (C:) is full, just by being mainly filled with WSL 2 containers, volumes and images.
My D: drive, however, is ...
So, I propose the following feature:
Provide a
data-path
option with DockerProvide a Data Path option with the Docker installer, allowing users to define a default folder for storing images, containers and volumes.
Add a new Data Path parameter to
docker build
,docker commit
,docker container create
,docker create
,docker run
, anddocker volume create
:--data-path
{destination path}The destination path is supposed to be a directory wherein the corresponding image, container or volume will create its own, internal, private sub directory to store its data. So, if the destination directory was
D:\DockerData\tmp
, then an image, for example, may first create a sub directory, likeD:\DockerData\tmp\03624fa1359\
to then store its data therein.Examples:
> docker build -t fromImage --data-path D:\DockerData\nano\ .
> docker run -d --name test --data-path D:\DockerData\nano\ fromImage
> docker volume create --data-path D:\DockerData\nano\ myStorage
The text was updated successfully, but these errors were encountered: