如何使用Docker Desktop(Windows)

huangapple go评论172阅读模式
英文:

How to use Docker Desktop (Windows)

问题

我刚刚在Win11上安装了Docker Desktop。我正在按照Docker Desktop应用程序中包含的教程进行操作,这些教程在首次安装Docker Desktop时在“学习中心”菜单下显示。但是它们没有回答一些非常基本的问题,比如:

Docker Desktop是否需要单独安装git,还是已经包含在内?
如何使用Docker Desktop(Windows)

其次,它假设我知道如何找到Dockerfile。

我不知道它在哪里 - 它在哪里?
如何使用Docker Desktop(Windows)

第三,如果我使用Docker Desktop拉取一个镜像,它会将镜像/文件存储在哪里?如果我在CLI中运行这个命令,我需要在DOS/PS提示符下运行,还是需要在WSL(Windows子系统Linux)shell中运行?我运行命令时应该在哪个目录下?

如何使用Docker Desktop(Windows)

第四,compose.yaml文件在哪里?

如何使用Docker Desktop(Windows)

第五,Docker项目文件夹是否需要相对于Docker Desktop应用程序本身位于特定位置,以使docker命令正常工作,还是我可以在任何适合我的文件夹管理方案的地方创建Docker项目文件夹?

如何使用Docker Desktop(Windows)

英文:

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?
如何使用Docker Desktop(Windows)

Secondly, it assumes I know where to find the Dockerfile.

I have no idea where it is - where is it?

如何使用Docker Desktop(Windows)

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?

如何使用Docker Desktop(Windows)

Fourthly, where is the compose.yaml file located?

如何使用Docker Desktop(Windows)

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?

如何使用Docker Desktop(Windows)

答案1

得分: 1

如果您提供更多关于您正在遵循哪个教程以及您尝试解决/学习问题的信息,您将获得更好的答案。根据提供的信息,可以采取以下步骤:

  1. 第一步是将示例应用程序下载到您自己的计算机上,这样您就可以查看Dockerfile或docker-compose并了解如何使用Docker。如果您的计算机上没有安装git,请先安装git,然后使用git clone命令将示例应用程序存储库克隆到您的计算机上。如果您对git不熟悉,请查阅git文档:https://git-scm.com/docs/git-clone

  2. 安装示例应用程序后,您应该在项目目录中看到Dockerfile和docker-compose文件。

  3. Docker的层和镜像存储在C:\ProgramData\docker目录下。有关更详细的信息,请参阅此页面:https://github.com/docker/getting-started-app

  4. 您可以在任何地方创建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:

  1. 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

  2. With the sample application installed, you should see Dockerfile and docker-compose inside the project directory.

  3. 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

  4. 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

huangapple
  • 本文由 发表于 2023年8月9日 16:00:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/76865717.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定