问题
I am having Windows 10 Home operating system. I have installed Docker toolbox.
I have created docker image of my .net core application by using following command.
$ docker build -t helloWorld:core .
Now I want to ship this image, to other machine. But I am not getting image file.
Can someone please tell me, where my image will get saved? Or is there any way, to specify docker image path in docker build command.
回答1:
On Windows 10, right click on the docker icon in the system tray (right hand side of task bar) and choose Settings... In the Advanced pane, you'll see something like:
回答2:
- By using the
docker info
command. - In the result - check for Docker Root Dir
This folder will conatins images, containers, ...
回答3:
mine can be found in "C:\Users\Public\Documents\Hyper-V\Virtual hard disks"
回答4:
When you have Windows Containers activated, your images are stored by default in C:\ProgramData\Docker\
To change this, you can edit the C:\ProgramData\Docker\config\daemon.json
and add a new "graph"
key with the new path... (notice that every backslash is escaped with another backslash)
Example:
{
"registry-mirrors": [],
"insecure-registries": [],
"debug": true,
"experimental": false,
"graph": "D:\\ProgramData\\Docker"
}
After that, you need to restart Docker service and you can verify your changes using docker info
command and look at Docker Root Dir
entry.
回答5:
you can use below command to export your image and can copy same to linux / another machine docker export [OPTIONS] CONTAINER
example:
docker export --output="latest.tar" red_panda
回答6:
The docker desktop for windows 10 has been moved here:
c:/users/<user>
/AppData/Roaming/Docker/settings.json
回答7:
To to ship this image, to another machine :
docker ps -a
#or docker container ls -a
docker commit <container-id> mynewimage
#start here if you never started your image
#(ex: if just created using docker build -t helloWorld:core .)
docker image ls
docker save mynewimage > /tmp/mynewimage.tar
On the other machine:
docker load < /tmp/mynewimage.tar
docker images
As explained in comments above, when working on windows with linux containers, containers resides within the docker disk image located at DockerDesktop/settings/advanced/DiskImageLocation
see here
来源:https://stackoverflow.com/questions/42250222/what-is-docker-image-location-on-windows-10