英文:
How to use Docker Desktop (Windows)
问题
我刚刚在Win11上安装了Docker Desktop。我正在按照Docker Desktop应用程序内置的教程进行操作,在首次安装Docker Desktop后,这些教程会在“学习中心”菜单下显示。但它们没有回答一些非常基本的问题,比如:
Docker Desktop是否需要我单独安装git,还是已经包含在内?
第二,它假设我知道在哪里找到Dockerfile。
我不知道它在哪里 - 它在哪里?
第三,如果我使用Docker Desktop拉取一个镜像,它会将镜像/文件存储在何处?如果我在CLI中运行此命令,我需要在DOS/PS提示符下运行,还是需要在WSL(Windows子系统Linux) shell中运行?运行时应该在哪个目录中?
第四,compose.yaml文件在哪里?
第五,Docker项目文件夹是否需要相对于Docker Desktop应用程序本身的特定位置才能正常工作,还是我可以在适合我的文件夹管理方案的任何地方创建Docker项目文件夹?
英文:
I have just installed Docker Desktop on Win11. I am following the tutorials that are included within the Docker Desktop App itself and which are presented upon first installing Docker Desktop under the "Learning Center" menu. They fail to answer some very basic questions, like:
Does Docker Desktop require that I install git separately, or is it included?
Secondly, it assumes I know where to find the Dockerfile.
I have no idea where it is - where is it?
Thirdly, if I pull an image down using Docker Desktop, where does it store the image/files locally? If I run this command in the CLI, do I need to be in a DOS/PS prompt, or do I need to run it from within the WSL (Windows Subsystem for Linux) shell? And what directory should I be in when I run it?
Fourthly, where is the compose.yaml file located?
Fifthly, do Docker project folders need to be located somewhere specifically relative to the Docker Desktop application itself for docker commands to work properly, or can I create Docker project folders anywhere that suits my folder management scheme?
答案1
得分: 1
以下是翻译好的部分:
-
第一步是将示例应用程序下载到您自己的计算机上,这样您可以查看 Dockerfile 或 docker-compose,并了解如何使用 Docker。如果您的计算机上没有安装 git,则应该安装它,然后使用
git clone
命令将示例应用程序存储库克隆到您的计算机上。如果您不熟悉 git,请查看 git 文档:https://git-scm.com/docs/git-clone -
安装了示例应用程序后,您应该在项目目录中看到 Dockerfile 和 docker-compose。
-
Docker 层和镜像存储在
C:\ProgramData\docker
。查看此页面以获取更详细的信息:https://github.com/docker/getting-started-app -
您可以在任何地方创建 Docker 项目,这些命令会使用 API 连接到 Docker 引擎,并在其自己的文件系统中创建图像/容器。有关更多信息,请参阅:https://docs.docker.com/get-started/overview/#docker-architecture
英文:
You could get better answers if you provide more information on which tutorial you are following, what did you tried to do to solve/learn about your problem, etc. Still, with the given information:
-
The first step is to download the sample application to your own machine so you can look at Dockerfile or docker-compose and understand how to use Docker. If you do not have git installed on your machine you should do so, then use
git clone
command to clone the sample application repository to your machine. Check out git documentation if you are not familiar: https://git-scm.com/docs/git-clone -
With the sample application installed, you should see Dockerfile and docker-compose inside the project directory.
-
Docker layers and images are stored at
C:\ProgramData\docker
. Check out this page for more detailed information: https://github.com/docker/getting-started-app -
You can create docker projects everywhere, the commands connect to the Docker engine with api and create the images/containers in its own file system. See for more info: https://docs.docker.com/get-started/overview/#docker-architecture
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论