Welcome to Docker for Mac!
(欢迎使用MAC版本的Docker)
Docker is a full development platform for creating containerized apps, and Docker for Mac is the best way to get started with Docker on a Mac.
(Docker是一个创建容器式APP的完整开发平台,并且Docker For Mac是在Mac上使用Docker的最佳方式)
Stable channel
This installer is fully baked and tested, and comes with the latest GA version of Docker Engine. This is the best channel to use if you want a reliable platform to work with. These releases follow a version schedule with a longer lead time than the betas, synched with Docker Engine releases and hotfixes.On the stable channel, you can select whether to send usage statistics and other data.
(稳定版本是经过完全测试过的,并且使用Docker Engine的最新的GA版本。如果你想要一个可靠的开发平台,这是最好的版本。这些版本遵循着比betas更长交付时间的版本计划,并且与Docker Engine的修补程序同步进行。在稳定版本中,你可以选择是否发送可用的统计信息和其他数据)
System Requirements: Docker for Mac will launch only if all of these requirements are met.
(系统要求:仅当满足所有这些要求时,Mac版Docker才会启动。)
Mac must be a 2010 or newer model, with Intel’s hardware support for memory management unit (MMU) virtualization; i.e., Extended Page Tables (EPT) and Unrestricted Mode.
(Mac必须是2010或更新的型号,具有英特尔对内存管理单元(MMU)虚拟化的硬件支持; 即扩展页表(EPT)和非限制模式。)
OS X El Capitan 10.11 and newer macOS releases are supported. At a minimum, Docker for Mac requires macOS Yosemite 10.10.3 or newer, with the caveat that going forward 10.10.x is a use-at-your-own risk proposition.
(支持OS X El Capitan 10.11和更新的MacOS版本。 至少Docker for Mac需要使用macOS Yosemite 10.10.3或更新版本,注意10.10.x之前的版本则自担风险。)
Starting with Docker for Mac stable release 1.13 (upcoming), and concurrent Beta releases, we will no longer address issues specific to OS X Yosemite 10.10. In future releases, Docker for Mac could stop working on OS X Yosemite 10.10 due to the deprecated status of this OS X version. We recommend upgrading to the latest version of macOS.
(从Docker for Mac稳定版1.13(即将推出)和并发的Beta版本开始,我们将不再解决OS X Yosemite 10.10特有的问题。 在将来的版本中,由于OS X版本的弃用状态,Docker for Mac可能会停止在OS X Yosemite 10.10上运行。 我们建议升级到最新版本的macOS。)
At least 4GB of RAM
(至少4GB的RAM)
VirtualBox prior to version 4.3.30 must NOT be installed (it is incompatible with Docker for Mac)
(不能安装版本4.3.30之前的VirtualBox(它与Mac的Docker不兼容))
You will be asked to authorize Docker.app
with your system password during the install process. Privileged access is needed to install networking components and links to the Docker apps.
(你会被要求授权Docker.app在安装的过程中使用系统密码,安装网络组件和Docker.apps的关联需要特权访问)
Double-click Docker.app
to start Docker.
(双击<code>Docker.app</code>来启动Docker)
Docker app in Hockeyapp
The whale in the top status bar indicates that Docker is running, and accessible from a terminal.
(在顶层bar条的鲸鱼图标表明Docker正在运行中,并且可以从terminal中访问)
Whale in menu bar
If you just installed the app, you also get a success message with suggested next steps and a link to this documentation. Click the whale ( ) in the status bar to dismiss this popup.
Docker success
(如果你刚安装应用,你会获得一条成功消息,它包含了建议后续的步骤和文档的链接,双击状态栏中的鲸鱼图标来关闭此弹出信息) Click the whale (
) to get Preferences, and other options.
Docker context menu
(单击鲸鱼图标获得首选项和其他选项。)
Select About Docker to verify that you have the latest version.
Congratulations! You are up and running with Docker for Mac.
(选择 About Docker 以验证您是否具有最新版本。
恭喜! 你使用Docker for Mac运行。)
Note: The above is an example. Your output will differ if you are running different (e.g., newer) versions.
(提示:上面只是个例子,如果你运行不同(例如更新)的版本,你的输出会不同)
Step 3. Explore the application and run examples
1.Open a command-line terminal, and run some Docker commands to verify that Docker is working as expected.
Some good commands to try are docker version
to check that you have the latest release installed, and docker ps
and docker run hello-world
to verify that Docker is running.
(步骤3.探索应用程序并运行实例:
1、打开命令行终端,并且运行一些Docker命令来验证Docker是否正常工作。
一些好的命令例如<code>docker version</code>检查是否为最新版本,并且<code>docker ps</code>和<code>docker run hello-world</code>来验证Docker正在运行)
2.For something more adventurous, start a Dockerized web server.
docker run -d -p 80:80 --name webserver nginx
(2、更进一步则是使用<code>docker run -d -p 80:80 --name webserver nginx</code>启动Dockerized Web服务器)
<pre>docker run -d -p 80:80 --name webserver nginx</pre>
Note: Early beta releases used docker
as the hostname to build the URL. Now, ports are exposed on the private IP addresses of the VM and forwarded to localhost
with no other host name set. See also, for Beta 9.
(提示:早期的测试版本使用<code>docker</code>来作为主机名构建URL,现在,端口会暴露在VM的私有IP地址上,并且转发到<code>localhost</code>而不需要设置其他主机名,详情参阅 )
Run docker ps while your web server is running to see details on the webserver container.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 56f433965490 nginx "nginx -g 'daemon off" About a minute ago Up About a minute 0.0.0.0:80->80/tcp, 443/tcp webserver
(当你的web服务器正在运行时,运行<code>docker ps</code>来查看webserver容器的详情)
<pre>
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
56f433965490 nginx "nginx -g 'daemon off" About a minute ago Up About a minute 0.0.0.0:80->80/tcp, 443/tcp webserver
</pre>
Stop or remove containers and images.
(停止或移除容器和镜像)
The <code>nginx</code> webserver will continue to run in the container on that port until you stop and/or remove the container. If you want to stop the webserver, type: <code>docker stop webserver</code> and start it again with <code>docker start webserver</code>. A stopped container will not show up with <code>docker ps</code>; for that, you need to run <code>docker ps -a</code>
(除非你终止或移除容器,否则<code>nginx</code>服务器会继续在那个端口的容器上运行。如果你想终止服务器,输入<code>docker stop webserver</code>并使用<code>docker start webserver</code>重启,一个已终止运行的容器中运行<code>docker ps</code>不会有显示,因此你需要运行<code>docker ps -a</code>)
To stop and remove the running container with a single command, type: <code>docker rm -f webserver</code>. This will remove the container, but not the <code>nginx</code> image. You can list local images with <code>docker images</code>. You might want to keep some images around so that you don’t have to pull them again from Docker Hub. To remove an image you no longer need, use <code>docker rmi</code> followed by an image ID or image name. For example, <code>docker rmi nginx</code>.
(为了停止并删除正在运行的容器,你需要键入一条命令 <code>docker rm -f webserver</code>,这可以移除容器,但不会移除<code>nginx</code>镜像,你可使用<code>docker images</code>列出本地镜像列表。你想要保留一些镜像,这样不必再从Docker Hub中拉取镜像。要删除你不再需要的镜像,请使用 <code>docker rmi</code>命令,后面参数为镜像的ID或镜像的名称。例如<code>docker rmi nginx</code>)
(从鲸鱼图标中的选项栏选择Preferences,你可以设置以下正在运行时选项 )
General
Preferences
Auto-start, update, and backups
Docker for Mac is set to automatically start when you log in. Uncheck the login autostart option if you don’t want Docker to start when you open your session.
(Auto-start, update, and backups:
Docker for Mac设置为在您登录时自动启动。如果您不希望在打开session时启动Docker,请取消选中login autostart选项。)
Docker for Mac is set to check for updates automatically and notify you when an update is available. If an update is found, click OK to accept and install it (or cancel to keep the current version). If you disable the check for updates, you can still find out about updates manually by choosing
->Check for Updates(Docker for Mac设置为自动检查更新,并在更新可用时通知您。 如果找到更新,单击OK接受并安装它(或取消保留当前版本)。 如果禁用检查更新,您仍然可以通过选择 - >Check for Updates)
CPUs
By default, Docker for Mac is set to use 2 processors. You can increase processing power for the app by setting this to a higher number, or lower it to have Docker for Mac use fewer computing resources.
(CPU:默认情况下,Docker for Mac设置为使用2个进程。 您可以通过将应用程序设置为更高的数字来提高应用程序的处理能力,或者降低它使Docker for Mac使用更少的计算资源。)
Memory
By default, Docker for Mac is set to use 2
GB runtime memory, allocated from the total available memory on your Mac. You can increase the RAM on the app to get faster performance by setting this number higher (for example to 3) or lower (to 1) if you want Docker for Mac to use less memory.
(内存:默认情况下,Docker for Mac设置为使用2 GB运行时内存,从Mac上的总可用内存中分配。 您可以增加应用程序的RAM以获得更快的性能,或者如果你希望Docker for Mac使用更少的内存,通过设置这个数字更高(例如到3)或更低(到1)。)
Tip: Beta dialogs — Starting with Beta 31, CPUs and Memory settings are on the Advanced dialog. Starting with Beta 33, you can specify the storage location of the Linux volume; i.e., where containers and images are stored. These settings are shown below.
(提示:测试版对话框 - 从Beta 31开始,CPU和内存设置位于高级对话框中。 从Beta 33开始,您可以指定Linux卷的存储位置; 即存储容器和图像的地方。 这些设置如下所示。)
Custom registries(自定义注册表)
As an alternative to using to store your public or private images or , you can use Docker to set up your own insecure . Add URLs for insecure registries and registry mirrors on which to host your images. (See also, in the FAQs.)
(添加用于托管你的镜像的不安全的注册表和注册表镜像的URLs,来作为使用 来存储你的公有或私有的镜像或的一种替代方法。)
Tip: Beta dialogs — Starting with Beta 31, options to set up your own registries are available as part of a new daemon tab. See ).
(提示:测试版对话框 - 从Beta 31开始,设置您自己的注册表的选项可作为新的守护程序选项卡的一部分。 参见Docker守护进程)。) Proxies settings
Server: Version: 1.13.0-rc3
API version: 1.25 (minimum version 1.12)
Go version: go1.7.3
Git commit: 4d92237
Built: Tue Dec 6 01:15:44 2016
OS/Arch: linux/amd64
Experimental: true
</pre>
Daemon Advanced (JSON configuration file)
(守护进程高级版(JSON 配置文件))
On the Daemon -> Advanced dialog, you can directly configure the daemon from the JSON file, and determine entirely how your containers will run. For a full list of options on the Docker daemon, see in the Docker Engine command line reference.
(在Daemon -> Advanced dialog中,你可以直接从JSON文件中配置daemon,并且完全指定你的容器是如何运行。Docker daemon中的一系列选项请在Docker Engine命令行参考中查看 )
After editing the daemon configuration , click Apply & Restart to save it and reboot Docker. Or, to cancel changes, click another preference tab, then choose to discard or not apply changes when asked.
Docker Daemon
(在编辑好daemon的配置后,点击Apply & Restart 来保存并且重启Docker,或者取消改变,点击另外的选项tab,然后在被询问的时候选择放弃或不改变。)
File sharing
You can decide which directories on your Mac to share with containers.
(你可以在你的MAC上选择哪个文件夹共享到容器中)
Add a Directory - Click +
and navigate to the directory you want to add.
(Add a Directory-点击<code>+</code>,选择你想要共享的文件夹的目录)
File Sharing Privacy
Tip: Beta dialogs — Starting with Beta 31, options to enable or disable auto-send of usage data are on the dialog.
(提示:测试版对话框 - 从Beta 31开始,在“常规”对话框中启用或禁用自动发送使用情况数据的选项。)
Also, you can enable or disable these auto-reporting settings with one click on the information popup when you first start Docker.
(此外,您可以在首次启动Docker时单击信息弹出窗口以启用或禁用这些自动报告设置。)
Uninstall or reset
Choose(选择) –> Preferences from the menu bar, then click Uninstall / Reset on the Preferences dialog.
(从菜单条中选择Preferences ,在Preferences dialog中点击 Uninstall / Reset)
Uninstall or reset Docker
Uninstall - Choose this option to remove Docker for Mac from your system.
(Uninstall - 选择这个选项来从你系统中移除Docker for Mac)
Reset to factory defaults - Choose this option to reset all options on Docker for Mac to its initial state, the same as when it was first installed.
(Reset to factory defaults - 选择这个选项来重置Docker for Mac中所有选项为第一次安装时候的初始状态)
You can uninstall Docker for Mac from the command line with this command: <DockerforMacPath> --uninstall. If Docker is installed in the default location, the following command will provide a clean uninstall.
(你可以使用命令行<DockerforMacPath> --uninstall卸载Docker for Mac,如果Docker是安装在默认位置,那下面这些命令可以提供干净的卸载)
<pre>
$ /Applications/Docker.app/Contents/MacOS/Docker --uninstall
Docker is running, exiting...
Docker uninstalled successfully. You can move the Docker application to the trash.
</pre>
You might want to use the command-line uninstall if, for example, you find that the app is non-functional, and you cannot uninstall it from the menu.
(如果发现应用程序无效或者你不可以从menu中卸载,你或许会想要命令行来卸载)
To give us feedback on the documentation or update it yourself, use the Feedback options at the bottom of each docs page.
(要向我们提供有关文档的反馈或自行更新,请使用每个文档页面底部的反馈选项。)