Вы находитесь на странице: 1из 8

Docs archive

Docker Datacenter archive

Install Docker Toolbox on macOS


Estimatedreadingtime:6minutes

macOSusersuseDockerToolboxtoinstallDockersoftware.DockerToolboxincludesthe
followingDockertools:
DockerCLIclientforrunningDockerEnginetocreateimagesandcontainers
DockerMachinesoyoucanrunDockerEnginecommandsfrommacOSterminals
DockerComposeforrunningthedocker-composecommand
Kitematic,theDockerGUI
theDockerQuickStartshellpreconfiguredforaDockercommand-lineenvironment
OracleVMVirtualBox
BecausetheDockerEnginedaemonusesLinux-specifickernelfeatures,youcantrunDocker
EnginenativelyinmacOS.Instead,youmustusetheDockerMachinecommand,dockermachine,tocreateandattachtoasmallLinuxVMonyourmachine.ThisVMhostsDocker
EngineforyouonyourMac.

Step 1: Check your version

YourMacmustberunningmacOS10.8MountainLionornewertorunDockersoftware.To
findoutwhatversionoftheOSyouhave:
1.ChooseAboutthisMacfromtheApplemenu.
TheversionnumberappearsdirectlybelowthewordsmacOS.
2.Ifyouhavethecorrectversion,gotothenextstep.
Ifyouarentusingasupportedversion,youcouldconsiderupgradingyouroperating
system.

IfyouhavemacOS10.10.3Yosemiteornewer,considerusingDockerforMac
(https://docs.docker.com/docker-for-mac/)instead.ItrunsnativelyontheMac,sothereis
noneedforapre-configuredDockerQuickStartshell.Itusesxhyveforvirtualization,
insteadofVirutalBox.FullinstallprerequisitesareprovidedintheDockerforMactopicin
DockerforMac(https://docs.docker.com/docker-for-mac/#what-to-know-before-youinstall).

Step 2: Install Docker Toolbox

1.InstallDockerToolboxbydouble-clickingthepackageorbyright-clickingandchoosing
Openfromthepop-upmenu.
Theinstallerlaunchesanintroductorydialog,followedbyanoverviewofwhatsinstalled.

2.PressContinuetoinstallthetoolbox.
Theinstallerpresentsyouwithoptionstocustomizethestandardinstallation.

Bydefault,thestandardDockerToolboxinstallation:
installsbinariesfortheDockertoolsin/usr/local/bin
makesthesebinariesavailabletoallusers
updatesanyexistingVirtualBoxinstallation
Fornow,dontchangeanyofthedefaults.
3.PressInstalltoperformthestandardinstallation.
Thesystempromptsyouforyourpassword.

4.Provideyourpasswordtocontinuewiththeinstallation.
Whenitcompletes,theinstallerprovidesyouwithsomeshortcuts.Youcanignorethisfor
nowandclickContinue.

ThenclickClosetofinishtheinstaller.

Step 3: Verify your installation

TorunaDockercontainer,you:
createanew(orstartanexisting)DockerEnginehostrunning
switchyourenvironmenttoyournewVM
usethedockerclienttocreate,load,andmanagecontainers
Onceyoucreateamachine,youcanreuseitasoftenasyoulike.LikeanyVirtualBoxVM,it
maintainsitsconfigurationbetweenuses.
1.OpentheLaunchpadandlocatetheDockerQuickstartTerminalicon.

2.ClicktheicontolaunchaDockerQuickstartTerminalwindow.
TheterminaldoesanumberofthingstosetupDockerQuickstartTerminalforyou.

Last login: Sat Jul 11 20:09:45 on ttys002


bash '/Applications/Docker Quickstart Terminal.app/Contents/Resources/Script
s/start.sh'
Get http:///var/run/docker.sock/v1.19/images/json?all=1&filters=%7B%22dangli
ng%22%3A%5B%22true%22%5D%7D: dial unix /var/run/docker.sock: no such file or
directory. Are you trying to connect to a TLS-enabled daemon without TLS?
Get http:///var/run/docker.sock/v1.19/images/json?all=1: dial unix /var/run/
docker.sock: no such file or directory. Are you trying to connect to a TLS-en
abled daemon without TLS?
-bash: lolcat: command not found
mary at meepers in ~
$ bash '/Applications/Docker Quickstart Terminal.app/Contents/Resources/Scri
pts/start.sh'
Creating Machine dev...
Creating VirtualBox VM...
Creating SSH key...
Starting VirtualBox VM...
Starting VM...
To see how to connect Docker to this machine, run: docker-machine env dev
Starting machine dev...
Setting environment variables for machine dev...
##
.
## ## ##
==
## ## ## ## ##
===
/"""""""""""""""""\___/ ===
~~~ {~~ ~~~~ ~~~ ~~~~ ~~~ ~ / ===- ~~~
\______ o
__/
\
\
__/
\____\_______/
The Docker Quick Start Terminal is configured to use Docker with the defaul
t VM.

3.Clickyourmouseintheterminalwindowtomakeitactive.
Ifyouarentfamiliarwithaterminalwindow,herearesomequicktips.

Thepromptistraditionallya$dollarsign.Youtypecommandsintothecommandline
whichistheareaaftertheprompt.Yourcursorisindicatedbyahighlightedareaora|that
appearsinthecommandline.Aftertypingacommand,alwayspressRETURN.
4.Typethedocker run hello-worldcommandandpressRETURN.
Thecommanddoessomeworkforyou,ifeverythingrunswell,thecommandsoutput
lookslikethis:

$ docker run hello-world


Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
535020c3e8ad: Pull complete
af340544ed62: Pull complete
Digest: sha256:a68868bfe696c00866942e8f5ca39e3e31b79c1e50feaee4ce5e28df2f051
d5c
Status: Downloaded newer image for hello-world:latest
Hello from Docker.
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker Engine CLI client contacted the Docker Engine daemon.
2. The Docker Engine daemon pulled the "hello-world" image from the Docker H
ub.
3. The Docker Engine daemon created a new container from that image which ru
ns the
executable that produces the output you are currently reading.
4. The Docker Engine daemon streamed that output to the Docker Engine CLI cl
ient, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker Hub account:
https://hub.docker.com
For more examples and ideas, visit:
https://docs.docker.com/userguide/

How to uninstall Toolbox

RemovingToolboxinvolvesremovingalltheDockercomponentsitincludes.
AfulluninstallalsoincludesremovingthelocalandremotemachinesyoucreatedwithDocker
Machine.Insomecases,youmightwanttokeepmachinescreatedwithDockerMachine.
Forexample,ifyouplantore-installDockerMachineasapartofDockerforMacyoucan
continuetomanagethosemachinesthroughDocker.Or,ifyouhaveremotemachinesona
cloudproviderandyouplantomanagethemusingtheprovider,youwouldntwantto
removethem.Sothesteptoremovemachinesisdescribedhereasoptional.

TouninstallToolboxonaMac,dothefollowing:
1.Listyourmachines.

$ docker-machine ls
NAME
ACTIVE
SWARM
dev
*
my-docker-machine
default

DRIVER

STATE

URL

virtualbox
virtualbox
virtualbox

Running
Stopped
Stopped

tcp://192.168.99.100:2376

2.Optionally,removeeachmachine.Forexample:

$ docker-machine rm my-docker-machine
Successfully removed my-docker-machine

3.RemovetheDockerQuickstartTerminalandKitematicfromyourApplicationsfolder.
4.Removethedocker,docker-compose,anddocker-machinecommandsfromthe
/usr/local/binfolder.

$ rm /usr/local/bin/docker
$ rm /usr/local/bin/docker-compose
$ rm /usr/local/bin/docker-machine

Feedback?Suggestions?Can'tfindsomethinginthedocs?
Editthispage
(https://github.com/docker/docker.github.io/edit/master/toolbox/toolbox_install_mac.md)
Requestdocschanges(https://github.com/docker/docker.github.io/issues/new?title=Feedback
for:toolbox/toolbox_install_mac.md&assignee=londoncalling&body=File:
[toolbox/toolbox_install_mac.md](https://docs.docker.com/toolbox/toolbox_install_mac/))
Getsupport(https://www.docker.com/docker-support-services)
Ratethispage: 2 2

Connect

Вам также может понравиться