Get started with Docker for Mac

以下原文轉(zhuǎn)載于(https://docs.docker.com/docker-for-mac/
(想找中文版的最新文檔,最后發(fā)現(xiàn)還是直接看英文的靠譜。
ps:本人英文很渣,以下翻譯純屬Google加上一些修改來讓我省些時(shí)間重新看英文,翻譯仍需花時(shí)間精改。有問題歡迎評論提出,謝謝0.0)

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是一個(gè)創(chuàng)建容器式APP的完整開發(fā)平臺,并且Docker For Mac是在Mac上使用Docker的最佳方式)

Already have Docker for Mac? If you already have Docker for Mac installed, and are ready to get started, skip down to Step 2. Check versions of Docker Engine, Compose, and Machine to work through the rest of the Docker for Mac tour, or jump over to the standard Getting Started with Docker tutorial.
開始使用Docker for Mac?如果你的Mac早已使用Docker,并且已經(jīng)開啟,則跳到第二步 Step 2. 檢查Docker Engine, Compose, and Machine的版本來繼續(xù)剩下的旅程,或者跳到Getting Started with Docker標(biāo)準(zhǔn)旅程)

Download Docker for Mac
(下載Docker for Mac)
If you have not already done so, please install Docker for Mac. You can download installers from the stable or beta channel. For more about stable and beta channels, see the FAQs.
(如果你還沒開始,請下載Docker for Mac。你可以下載穩(wěn)定或測試版本,想要獲取更多信息,看 FAQs

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.
(穩(wěn)定版本是經(jīng)過完全測試過的,并且使用Docker Engine的最新的GA版本。如果你想要一個(gè)可靠的開發(fā)平臺,這是最好的版本。這些版本遵循著比betas更長交付時(shí)間的版本計(jì)劃,并且與Docker Engine的修補(bǔ)程序同步進(jìn)行。在穩(wěn)定版本中,你可以選擇是否發(fā)送可用的統(tǒng)計(jì)信息和其他數(shù)據(jù))

Important Notes(關(guān)鍵提示):
Docker for Mac requires OS X El Capitan 10.11 or newer macOS release running on a 2010 or newer Mac, with Intel’s hardware support for MMU virtualization. The app will run on 10.10.3 Yosemite, but with limited support. Please see What to know before you install for a full explanation and list of prerequisites.
(Docker for Mac要求OS X El Capitan 10.11或者更新的macOS版本,必須是2010或更新的型號,具有英特爾對內(nèi)存管理單元(MMU)虛擬化的硬件支持,應(yīng)用也可運(yùn)行在10.10.3 Yosemite上,但會有限制,詳情What to know before you install來查看完整說明和要求)

You can switch between beta and stable versions, but you must have only one app installed at a time. Also, you will need to save images and export containers you want to keep before uninstalling the current version before installing another. For more about this, see the FAQs about beta and stable channels.
(你可在測試版和穩(wěn)定版中進(jìn)行切換,但你同時(shí)只能安裝其中一個(gè)應(yīng)用,并且,在卸載當(dāng)前的版本之前,你需要保存好鏡像并導(dǎo)出你想要保存的容器,然后再安裝另外一個(gè),想獲取更多信息,請查看 FAQs about beta and stable channels。)

What to know before you install(https://docs.docker.com/docker-for-mac/#what-to-know-before-you-install)(安裝前須知)
README FIRST for Docker Toolbox and Docker Machine users: If you are already running Docker on your machine, first read Docker for Mac vs. Docker Toolbox to understand the impact of this installation on your existing setup, how to set your environment for Docker for Mac, and how the two products can coexist.
(Docker Toolbox 和 Docker Machine 用戶須先閱讀:如果你早已在你的機(jī)器上運(yùn)行Docker,請首先閱讀Docker for Mac vs. Docker Toolbox以了解此安裝對您現(xiàn)有設(shè)置的影響,如何為Docker for Mac設(shè)置環(huán)境 ,以及這兩種產(chǎn)品如何共存。)

Relationship to Docker Machine: Installing Docker for Mac does not affect machines you created with Docker Machine. You’ll get the option to copy containers and images from your local default
machine (if one exists) to the new Docker for Mac HyperKit VM. When you are running Docker for Mac, you do not need Docker Machine nodes running at all locally (or anywhere else). With Docker for Mac, you have a new, native virtualization system running (HyperKit) which takes the place of the VirtualBox system. To learn more, see Docker for Mac vs. Docker Toolbox.
(Docker Machine的關(guān)聯(lián):安裝Docker for Mac不會影響你使用Docker Machine來安裝的機(jī)器。你可以從你本地的默認(rèn)機(jī)器(如果存在的話)復(fù)制容器和鏡像中的選項(xiàng)到新的Docker for MacHyperKit VM。當(dāng)你運(yùn)行Docker for Mac時(shí),你不需要在本地(或其他任何地方)的運(yùn)行Docker Machine節(jié)點(diǎn),使用Docker for Mac,您會有一個(gè)新的本地虛擬化系統(tǒng)(HyperKit),它代替了VirtualBox系統(tǒng)。 要了解更多信息,請參閱 Docker for Mac vs. Docker Toolbox

System Requirements: Docker for Mac will launch only if all of these requirements are met.
(系統(tǒng)要求:僅當(dāng)滿足所有這些要求時(shí),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或更新的型號,具有英特爾對內(nèi)存管理單元(MMU)虛擬化的硬件支持; 即擴(kuò)展頁表(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之前的版本則自擔(dān)風(fēng)險(xiǎn)。)

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穩(wěn)定版1.13(即將推出)和并發(fā)的Beta版本開始,我們將不再解決OS X Yosemite 10.10特有的問題。 在將來的版本中,由于OS X版本的棄用狀態(tài),Docker for Mac可能會停止在OS X Yosemite 10.10上運(yùn)行。 我們建議升級到最新版本的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不兼容))

Note: If your system does not satisfy these requirements, you can install Docker Toolbox, which uses Oracle Virtual Box instead of HyperKit.
(注意:如果您的系統(tǒng)不滿足這些要求,您可以安裝Docker Toolbox,它使用Oracle Virtual Box而不是HyperKit。)

What the install includes: The installation provides Docker Engine, Docker CLI client, Docker Compose, and Docker Machine.
(安裝包里包括: Docker Engine, Docker CLI client, Docker Compose, and Docker Machine

Step 1. Install and Run Docker for Mac
Double-click Docker.dmg
to open the installer, then drag Moby the whale to the Applications folder.
(步驟1.安裝并運(yùn)行Docker for Mac,雙擊<code>Docker.dmg</code>來打開安裝包,然后拖動Docker.app到Application文件夾)

Install Docker app
Install Docker app

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.
(你會被要求授權(quán)Docker.app在安裝的過程中使用系統(tǒng)密碼,安裝網(wǎng)絡(luò)組件和Docker.apps的關(guān)聯(lián)需要特權(quán)訪問)

Double-click Docker.app
to start Docker.
(雙擊<code>Docker.app</code>來啟動Docker)


Docker app in Hockeyapp
Docker app in Hockeyapp

The whale in the top status bar indicates that Docker is running, and accessible from a terminal.
(在頂層bar條的鯨魚圖標(biāo)表明Docker正在運(yùn)行中,并且可以從terminal中訪問)


Whale in menu bar
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
Docker success

(如果你剛安裝應(yīng)用,你會獲得一條成功消息,它包含了建議后續(xù)的步驟和文檔的鏈接,雙擊狀態(tài)欄中的鯨魚圖標(biāo)來關(guān)閉此彈出信息)

Click the whale (

) to get Preferences, and other options.


Docker context menu
Docker context menu

(單擊鯨魚圖標(biāo)獲得首選項(xiàng)和其他選項(xiàng)。)

Select About Docker to verify that you have the latest version.
Congratulations! You are up and running with Docker for Mac.
(選擇 About Docker 以驗(yàn)證您是否具有最新版本。
恭喜! 你使用Docker for Mac運(yùn)行。)

Step 2. Check versions of Docker Engine, Compose, and Machine
(步驟2.檢查Docker Engine,Compose和Machine的版本)
Run these commands to test if your versions of docker, docker-compose, and docker-machine are up-to-date and compatible with Docker.app
(運(yùn)行下面命令來測試你的<code>docker</code>、<code>docker-compose</code>、<code>docker-machine</code>的版本是否需要升級并與Docker.app兼容)
<pre>
$ docker --version
Docker version 1.13.0-rc3, build 4d92237
$ docker-compose --version
docker-compose version 1.9.0, build 2585387
$ docker-machine --version
docker-machine version 0.9.0-rc2, build 7b19591
</pre>

Note: The above is an example. Your output will differ if you are running different (e.g., newer) versions.
提示:上面只是個(gè)例子,如果你運(yùn)行不同(例如更新)的版本,你的輸出會不同)

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.探索應(yīng)用程序并運(yùn)行實(shí)例:
1、打開命令行終端,并且運(yùn)行一些Docker命令來驗(yàn)證Docker是否正常工作。
一些好的命令例如<code>docker version</code>檢查是否為最新版本,并且<code>docker ps</code>和<code>docker run hello-world</code>來驗(yàn)證Docker正在運(yùn)行)

2.For something more adventurous, start a Dockerized web server.
docker run -d -p 80:80 --name webserver nginx
(2、更進(jìn)一步則是使用<code>docker run -d -p 80:80 --name webserver nginx</code>啟動Dockerized Web服務(wù)器)
<pre>docker run -d -p 80:80 --name webserver nginx</pre>

If the image is not found locally, Docker will pull it from Docker Hub.
In a web browser, go to http://localhost/ to bring up the home page. (Since you specified the default HTTP port, it isn’t necessary to append :80
at the end of the URL.)
(如果本地沒有找到鏡像,Docker會從Docker Hub中拉取。在瀏覽器中,進(jìn)入<code>http://localhost/ </code>來打開主頁(由于你指定了默認(rèn)的http端口,所以不需要在URL的末尾添加<code>:80</code>))

nginx home page
nginx home page

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, Release Notes for Beta 9.
提示:早期的測試版本使用<code>docker</code>來作為主機(jī)名構(gòu)建URL,現(xiàn)在,端口會暴露在VM的私有IP地址上,并且轉(zhuǎn)發(fā)到<code>localhost</code>而不需要設(shè)置其他主機(jī)名,詳情參閱Beta9的發(fā)行說明

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
(當(dāng)你的web服務(wù)器正在運(yùn)行時(shí),運(yùn)行<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>服務(wù)器會繼續(xù)在那個(gè)端口的容器上運(yùn)行。如果你想終止服務(wù)器,輸入<code>docker stop webserver</code>并使用<code>docker start webserver</code>重啟,一個(gè)已終止運(yùn)行的容器中運(yùn)行<code>docker ps</code>不會有顯示,因此你需要運(yùn)行<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>.
(為了停止并刪除正在運(yùn)行的容器,你需要鍵入一條命令 <code>docker rm -f webserver</code>,這可以移除容器,但不會移除<code>nginx</code>鏡像,你可使用<code>docker images</code>列出本地鏡像列表。你想要保留一些鏡像,這樣不必再從Docker Hub中拉取鏡像。要刪除你不再需要的鏡像,請使用 <code>docker rmi</code>命令,后面參數(shù)為鏡像的ID或鏡像的名稱。例如<code>docker rmi nginx</code>)

Want more example applications? - For more example walkthroughs that include setting up services and databases in Docker Compose, see Example Applications.
想要更多的示例演練?-有關(guān)更多示例演練,包括在Docker Compose中設(shè)置服務(wù)和數(shù)據(jù)庫,請參閱 示例演練

Preferences(優(yōu)先選項(xiàng)
Choose(選擇)

–> Preferences from the menu bar. You can set the following runtime options.
(從鯨魚圖標(biāo)中的選項(xiàng)欄選擇Preferences,你可以設(shè)置以下正在運(yùn)行時(shí)選項(xiàng) )
General
Preferences
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設(shè)置為在您登錄時(shí)自動啟動。如果您不希望在打開session時(shí)啟動Docker,請取消選中l(wèi)ogin autostart選項(xiàng)。)

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設(shè)置為自動檢查更新,并在更新可用時(shí)通知您。 如果找到更新,單擊OK接受并安裝它(或取消保留當(dāng)前版本)。 如果禁用檢查更新,您仍然可以通過選擇 - >Check for Updates

Check Exclude VM from Time Machine backups to prevent Time Machine from backing up the Docker for Mac virtual machine.
Tip: Beta dialogs — Starting with Beta 31, an option to auto-send usage data is also on the General dialog. In Stable releases, the option is still on the Privacy tab. For now, both Stable and Beta users can read more about usage data settings in the Privacy topic.
(選中Exclude VM from Time Machine backups ,以防止Time Machine備份Mac虛擬機(jī)的Docker)
(提示:測試版對話框 - 從Beta 31開始,自動發(fā)送使用情況數(shù)據(jù)的選項(xiàng)也在常規(guī)對話框中。 在穩(wěn)定版本中,此選項(xiàng)仍在“隱私”選項(xiàng)卡上。 現(xiàn)在,穩(wěn)定版和測試版用戶都可以在隱私主題中了解有關(guān)使用情況數(shù)據(jù)設(shè)置的更多信息。)

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:默認(rèn)情況下,Docker for Mac設(shè)置為使用2個(gè)進(jìn)程。 您可以通過將應(yīng)用程序設(shè)置為更高的數(shù)字來提高應(yīng)用程序的處理能力,或者降低它使Docker for Mac使用更少的計(jì)算資源。)

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.
(內(nèi)存:默認(rèn)情況下,Docker for Mac設(shè)置為使用2 GB運(yùn)行時(shí)內(nèi)存,從Mac上的總可用內(nèi)存中分配。 您可以增加應(yīng)用程序的RAM以獲得更快的性能,或者如果你希望Docker for Mac使用更少的內(nèi)存,通過設(shè)置這個(gè)數(shù)字更高(例如到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和內(nèi)存設(shè)置位于高級對話框中。 從Beta 33開始,您可以指定Linux卷的存儲位置; 即存儲容器和圖像的地方。 這些設(shè)置如下所示。)

CPUs and Memory settings UIstarting at Beta 31
CPUs and Memory settings UIstarting at Beta 31

Advanced

Advanced Preference settings-advanced
Advanced Preference settings-advanced

Custom registries(自定義注冊表)
As an alternative to using Docker Hub to store your public or private images or Docker Trusted Registry, you can use Docker to set up your own insecure registry. Add URLs for insecure registries and registry mirrors on which to host your images. (See also, How do I add custom CA certificates? in the FAQs.)
(添加用于托管你的鏡像的不安全的注冊表和注冊表鏡像的URLs,來作為使用Docker Hub 來存儲你的公有或私有的鏡像或Docker可信的注冊表的一種替代方法。)
Tip: Beta dialogs — Starting with Beta 31, options to set up your own registries are available as part of a new daemon tab. See Docker daemon).
(提示:測試版對話框 - 從Beta 31開始,設(shè)置您自己的注冊表的選項(xiàng)可作為新的守護(hù)程序選項(xiàng)卡的一部分。 參見Docker守護(hù)進(jìn)程)。)

HTTP proxy settings
Docker for Mac will detect HTTP/HTTPS Proxy Settings and automatically propagate these to Docker and to your containers. For example, if you set your proxy settings to http://proxy.example.com, Docker will use this proxy when pulling containers.
(TTP代理設(shè)置:Docker for Mac將檢測HTTP / HTTPS代理設(shè)置,并自動將這些傳播到Docker和您的容器。 例如,如果您將代理設(shè)置設(shè)置為http://proxy.example.com,Docker將在提取容器時(shí)使用此代理。)
Tip: Beta dialogs — Starting with Beta 31, HTTP proxy settings are provided on a dedicated dialog, as shown below.
(提示:測試版對話框 - 從Beta 31開始,HTTP代理設(shè)置在專用對話框中提供,如下所示。)

Proxies settings
Proxies settings

Docker Daemon (Beta feature)
Starting with Beta 31, configuration options on the Docker daemon move to their own Daemon tab, including basic and advanced options.
(Docker守護(hù)進(jìn)程(測試版功能):從Beta 31開始,Docker守護(hù)程序上的配置選項(xiàng)移動到自己的Daemon選項(xiàng)卡,包括基本和高級選項(xiàng)。)

Daemon Basic (experimental mode and registries)
By default, Docker for Mac Beta releases use the experimental version of Docker Engine, described in the Docker Experimental Features README on GitHub. Starting with Beta 31, you can toggleexperimental mode on and off. If you toggle it off, Docker for Mac Beta uses the current generally available release of Docker Engine, the same as Stable Docker for Mac versions uses.
(Daemon基礎(chǔ)(實(shí)驗(yàn)?zāi)J胶妥员恚耗J(rèn)情況下,Docker for Mac Beta版本使用Docker Engine的實(shí)驗(yàn)版本,在GitHub上的Docker Experimental Features README中進(jìn)行了描述。 從Beta 31開始,您可以開啟和關(guān)閉實(shí)驗(yàn)?zāi)J健?如果您關(guān)閉它,Docker for Mac Beta使用當(dāng)前普遍可用的Docker Engine發(fā)行版,與Mac版本使用的Stable Docker相同。)
You can check whether you are running experimental mode or not by typing <code>docker version</code> on the command line. Experimental mode is listed under Server data. If Experimental is true, then Docker is running in experimental mode, as shown here. (If false, Experimental mode is off.)
(您可以通過在命令行中鍵入<code>docker version</code>來檢查您是否正在運(yùn)行實(shí)驗(yàn)?zāi)J健?實(shí)驗(yàn)?zāi)J搅性诜?wù)器數(shù)據(jù)下。 如果Experimental是true,那么Docker正在實(shí)驗(yàn)?zāi)J较逻\(yùn)行,如下所示。 (如果為false,實(shí)驗(yàn)?zāi)J揭殃P(guān)閉。))
<pre>
$ docker version
Client: Version: 1.13.0-rc3
API version: 1.25
Go version: go1.7.3
Git commit: 4d92237
Built: Tue Dec 6 01:15:44 2016
OS/Arch: darwin/amd64

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>

You can use Docker to set up your own registries. For details on this, see Custom Registries.
(你可以使用Docker來設(shè)置你自己的registries。更多詳情請看Custom Registries

Daemon
Daemon

Daemon Advanced (JSON configuration file)
(守護(hù)進(jìn)程高級版(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, seedaemon in the Docker Engine command line reference.
(在Daemon -> Advanced dialog中,你可以直接從JSON文件中配置daemon,并且完全指定你的容器是如何運(yùn)行。Docker daemon中的一系列選項(xiàng)請?jiān)贒ocker Engine命令行參考中查看daemon
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
Docker Daemon

(在編輯好daemon的配置后,點(diǎn)擊Apply & Restart 來保存并且重啟Docker,或者取消改變,點(diǎn)擊另外的選項(xiàng)tab,然后在被詢問的時(shí)候選擇放棄或不改變。)
File sharing文件共享
You can decide which directories on your Mac to share with containers.
(你可以在你的MAC上選擇哪個(gè)文件夾共享到容器中)
Add a Directory - Click +
and navigate to the directory you want to add.
Add a Directory-點(diǎn)擊<code>+</code>,選擇你想要共享的文件夾的目錄)
File Sharing
File Sharing

Click Apply & Restart to make the directory available to containers using Docker’s bind mount (-v) feature.
(點(diǎn)擊Apply & Restart來使用Docker的綁定安裝(-v)特性使該目錄在該容器有效)
There are some limitations on the directories that can be shared:
They cannot be a subdirectory of an already shared directory.
They cannot already exist inside of Docker.
See Namespaces in the topic on osxfs file system sharing for more information.
(可共享的目錄有一些限制:
它們不能是已共享目錄的子目錄。
它們不能在Docker中存在。
有關(guān)詳細(xì)信息,請參閱osxfs文件系統(tǒng)共享主題中的命名空間。)

Tip: File sharing is required for volume mounting if the project lives outside of the /Users directory. In that case, share the drive where the Dockerfile and volume are located. Otherwise, you will get file not found or cannot start service errors at runtime. (See also Volume mounting requires file sharing for any project directories outside of /Users
.)
(提示:如果項(xiàng)目位于/ Users目錄之外,則卷安裝需要文件共享。 在這種情況下,請共享Dockerfile和卷所在的驅(qū)動器。 否則,您將得到文件未找到或無法在運(yùn)行時(shí)啟動服務(wù)錯(cuò)誤。 (另請參見Volume mounting requires file sharing for any project directories outside of /Users
.)

Privacy私有
You can set Docker for Mac to auto-send diagnostics, crash reports, and usage data. This information can help Docker improve the application and get more context for troubleshooting problems.
(您可以將Docker for Mac設(shè)置為自動發(fā)送診斷,崩潰報(bào)告和使用數(shù)據(jù)。 這些信息可以幫助Docker改進(jìn)應(yīng)用程序,并獲得更多的上下文以解決問題。)
Uncheck any of the options to opt out and prevent auto-send of data. Docker may prompt for more information in some cases, even with auto-send enabled.
(取消選中任何選項(xiàng)可選擇停用,并阻止自動發(fā)送數(shù)據(jù)。 Docker在某些情況下可能會提示更多信息,即使啟用了自動發(fā)送。)

Privacy
Privacy

Tip: Beta dialogs — Starting with Beta 31, options to enable or disable auto-send of usage data are on the General dialog.
(提示:測試版對話框 - 從Beta 31開始,在“常規(guī)”對話框中啟用或禁用自動發(fā)送使用情況數(shù)據(jù)的選項(xiàng)。)

Also, you can enable or disable these auto-reporting settings with one click on the information popup when you first start Docker.
(此外,您可以在首次啟動Docker時(shí)單擊信息彈出窗口以啟用或禁用這些自動報(bào)告設(shè)置。)

Startup information
Startup information

Uninstall or reset
Choose(選擇)
–> Preferences from the menu bar, then click Uninstall / Reset on the Preferences dialog.
(從菜單條中選擇Preferences ,在Preferences dialog中點(diǎn)擊 Uninstall / Reset
Uninstall or reset Docker
Uninstall or reset Docker

Uninstall - Choose this option to remove Docker for Mac from your system.
Uninstall - 選擇這個(gè)選項(xiàng)來從你系統(tǒng)中移除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 - 選擇這個(gè)選項(xiàng)來重置Docker for Mac中所有選項(xiàng)為第一次安裝時(shí)候的初始狀態(tài))

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是安裝在默認(rèn)位置,那下面這些命令可以提供干凈的卸載)
<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.
(如果發(fā)現(xiàn)應(yīng)用程序無效或者你不可以從menu中卸載,你或許會想要命令行來卸載)

Installing bash completion
If you are using bash completion, such as homebrew bash-completion on Mac, bash completion scripts for - docker - docker-machine - docker-compose may be found inside Docker.app, in the Contents/Resources/etc folder.
(如果你正在使用bash completion,例如homebrew bash-completion on Mac,Docker.app在文件夾Contents/Resources/etc中會發(fā)現(xiàn)- docker - docker-machine - docker-compose的bash completion script)

To activate bash completion, these files need to be copied or symlinked to your bash_completion.d directory. For example, if you use Homebrew:
(為了是bash completion生效,下面這些文件需要被復(fù)制并連接到你的bash_completion.d目錄下,例如,如果你使用Homebrew:)
<pre>
ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion /usr/local/etc/bash_completion.d/docker
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion /usr/local/etc/bash_completion.d/docker-machine
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion /usr/local/etc/bash_completion.d/docker-compose
</pre>

Giving feedback and getting help
To get help from the community, review current user topics, join or start a discussion, log on to ourDocker for Mac forum.
(要從社區(qū)獲得幫助,查看當(dāng)前用戶主題,加入或開始討論,登錄我們的Docker for Mac論壇。)

To report bugs or problems, log on to Docker for Mac issues on GitHub, where you can review community reported issues, and file new ones. See Diagnose problems, send feedback, and create GitHub issues. As a part of reporting issues on GitHub, we can help you troubleshoot the log data.
(要報(bào)告錯(cuò)誤或問題,請?jiān)贕itHub上登錄Docker for Mac問題,您可以在其中查看社區(qū)報(bào)告的問題并提交新問題。 請參閱診斷問題,發(fā)送反饋和創(chuàng)建GitHub問題。 作為GitHub的報(bào)告問題的一部分,我們可以幫助您排查日志數(shù)據(jù)。)

To give us feedback on the documentation or update it yourself, use the Feedback options at the bottom of each docs page.
(要向我們提供有關(guān)文檔的反饋或自行更新,請使用每個(gè)文檔頁面底部的反饋選項(xiàng)。)

Where to go next
Try out the Getting Started with Docker tutorial.
(試試Docker入門教程。)

Dig in deeper with learn by example tutorials on building images, running containers, networking, managing data, and storing images on Docker Hub.
(深入了解在Docker Hub上構(gòu)建圖像,運(yùn)行容器,網(wǎng)絡(luò),管理數(shù)據(jù)和存儲圖像的示例教程)

See Example Applications for example applications that include setting up services and databases in Docker Compose.
(請參閱示例應(yīng)用程序的示例應(yīng)用程序,包括在Docker Compose中設(shè)置服務(wù)和數(shù)據(jù)庫。)

Interested in trying out the new swarm mode on Docker Engine v1.12?
(有興趣在Docker Engine v1.12上試用新的群模式嗎?)
See Get started with swarm mode, a tutorial which includes specifics on how to leverage your Docker for Mac installation to run single and multi-node swarms.
(請參閱開始使用swarm模式,這是一個(gè)教程,其中包括如何利用Docker for Mac安裝來運(yùn)行單節(jié)點(diǎn)和多節(jié)點(diǎn)群集。)
Also, try out the Swarm examples in docker labs. Run the bash script and follow the accompanying Docker Swarm Tutorial. The script uses Docker Machine to create a multi-node swarm, then walks you through various Swarm tasks and commands.
(另外,在Docker實(shí)驗(yàn)室里試試Swarm的例子。運(yùn)行bash腳本,并按照相應(yīng)的Docker Swarm教程。該腳本使用Docker Machine創(chuàng)建多節(jié)點(diǎn)群集,然后引導(dǎo)您完成各種Swarm任務(wù)和命令。)

For a summary of Docker command line interface (CLI) commands, see Docker CLI Reference Guide.
(有關(guān)Docker命令行界面(CLI)命令的摘要,請參閱“Docker CLI參考指南”。)

Check out the blog posts on Docker for Mac and Docker for Windows public betas, and earlier postson the initial private beta.
(查看Docker for Mac和Docker for Windows公共beta版的博客文章,以及最初的私人測試版的更早版本。)

Please give feedback on your experience with the app and report bugs and problems by logging into our Docker for Mac forum.
(請?zhí)峁┓答伳膽?yīng)用程序的經(jīng)驗(yàn),并報(bào)告錯(cuò)誤和問題登錄我們的Docker for Mac論壇。)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容