windows安装docker官方说明.docx

上传人:b****1 文档编号:1907234 上传时间:2023-05-02 格式:DOCX 页数:12 大小:411.04KB
下载 相关 举报
windows安装docker官方说明.docx_第1页
第1页 / 共12页
windows安装docker官方说明.docx_第2页
第2页 / 共12页
windows安装docker官方说明.docx_第3页
第3页 / 共12页
windows安装docker官方说明.docx_第4页
第4页 / 共12页
windows安装docker官方说明.docx_第5页
第5页 / 共12页
windows安装docker官方说明.docx_第6页
第6页 / 共12页
windows安装docker官方说明.docx_第7页
第7页 / 共12页
windows安装docker官方说明.docx_第8页
第8页 / 共12页
windows安装docker官方说明.docx_第9页
第9页 / 共12页
windows安装docker官方说明.docx_第10页
第10页 / 共12页
windows安装docker官方说明.docx_第11页
第11页 / 共12页
windows安装docker官方说明.docx_第12页
第12页 / 共12页
亲,该文档总共12页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

windows安装docker官方说明.docx

《windows安装docker官方说明.docx》由会员分享,可在线阅读,更多相关《windows安装docker官方说明.docx(12页珍藏版)》请在冰点文库上搜索。

windows安装docker官方说明.docx

windows安装docker官方说明

Windows

Note:

ThisreleaseofDockerdeprecatestheBoot2DockercommandlineinfavorofDockerMachine.UsetheDockerToolboxtoinstallDockerMachineaswellastheotherDockertools.

YouinstallDockerusingDockerToolbox.DockerToolboxincludesthefollowingDockertools:

∙DockerMachineforrunningthe docker-machine binary

∙DockerEngineforrunningthe docker binary

∙Kitematic,theDockerGUI

∙ashellpreconfiguredforaDockercommand-lineenvironment

∙OracleVMVirtualBox

BecausetheDockerdaemonusesLinux-specifickernelfeatures,youcan’trunDockernativelyinWindows.Instead,youmustuse docker-machine tocreateandattachtoaDockerVMonyourmachine.ThisVMhostsDockerforyouonyourWindowssystem.

ThevirtualmachinerunsalightweightLinuxdistributionmadespecificallytoruntheDockerdaemon.TheVirtualBoxVMrunscompletelyfromRAM,isasmall~24MBdownload,andbootsinapproximately5s.

Requirements

TorunDocker,yourmachinemusthavea64-bitoperatingsystemrunningWindows7orhigher.Additionally,youmustmakesurethatvirtualizationisenabledonyourmachine.Toverifyyourmachinemeetstheserequirements,dothefollowing:

1.RightclicktheWindowsStartMenuandchoose System.

IfyouareusinganunsupportedversionofWindows,youshouldconsiderupgradingyouroperatingsysteminordertotryoutDocker.

2.MakesureyourCPUsupports virtualizationtechnology andvirtualizationsupportisenabledinBIOSandrecognizedbyWindows.

ForWindows8,8.1or10

Choose Start>TaskManager.OnWindows10,clickmoredetails.NavigatetothePerformance tab.Under CPU youshouldseethefollowing:

Ifvirtualizationisnotenabledonyoursystem,followthemanufacturer’sinstructionsforenablingit.

ForWindows7

Runthe Microsoft®Hardware-AssistedVirtualizationDetectionTool andfollowtheon-screeninstructions.

3.VerifyyourWindowsOSis64-bit(x64)

HowyoudothisverificationdependsonyourWindowsversion.Fordetails,seetheWindowsarticle Howtodeterminewhetheracomputerisrunninga32-bitversionor64-bitversionoftheWindowsoperatingsystem.

Note:

IfyouhaveDockerhostsrunningandyoudon’twishtodoaDockerToolboxinstallation,youcaninstallthe docker.exe usingthe unofficial WindowspackagemanagerChocolatey.Forinformationonhowtodothis,see DockerpackageonChocolatey.

Learnthekeyconceptsbeforeinstalling

InaDockerinstallationonLinux,yourmachineisboththelocalhostandtheDockerhost.Innetworking,localhostmeansyourcomputer.TheDockerhostisthemachineonwhichthecontainersrun.

OnatypicalLinuxinstallation,theDockerclient,theDockerdaemon,andanycontainersrundirectlyonyourlocalhost.ThismeansyoucanaddressportsonaDockercontainerusingstandardlocalhostaddressingsuchas localhost:

8000 or0.0.0.0:

8376.

InanWindowsinstallation,the docker daemonisrunninginsideaLinuxvirtualmachine.YouusetheWindowsDockerclienttotalktotheDockerhostVM.YourDockercontainersruninsidethishost.

InWindows,theDockerhostaddressistheaddressoftheLinuxVM.WhenyoustarttheVMwith docker-machine itisassignedanIPaddress.Whenyoustartacontainer,theportsonacontainermaptoportsontheVM.Toseethisinpractice,workthroughtheexercisesonthispage.

Installation

IfyouhaveVirtualBoxrunning,youmustshutitdownbeforerunningtheinstaller.

1.Gotothe DockerToolbox page.

2.Clicktheinstallerlinktodownload.

3.InstallDockerToolboxbydouble-clickingtheinstaller.

Theinstallerlaunchesthe“Setup-DockerToolbox”dialog.

4.Press“Next”toinstallthetoolbox.

Theinstallerpresentsyouwithoptionstocustomizethestandardinstallation.Bydefault,thestandardDockerToolboxinstallation:

oinstallsexecutablesfortheDockertoolsinC:

\ProgramFiles\DockerToolbox

oinstallVirtualBox;orupdatesanyexistinginstallation

oaddsaDockerInc.foldertoyourprogramshortcuts

oupdatesyour PATH environmentvariable

oaddsdesktopiconsfortheDockerQuickstartTerminalandKitematic

Thisinstallationassumesthedefaultsareacceptable.

5.Press“Next”untilyoureachthe“ReadytoInstall”page.

Thesystempromptsyouforyourpassword.

6.Press“Install”tocontinuewiththeinstallation.

Whenitcompletes,theinstallerprovidesyouwithsomeinformationyoucanusetocompletesomecommontasks.

7.Press“Finish”toexit.

RunningaDockerContainer

TorunaDockercontainer,you:

∙createanew(orstartanexisting)Dockervirtualmachine

∙switchyourenvironmenttoyournewVM

∙usethe docker clienttocreate,load,andmanagecontainers

Onceyoucreateamachine,youcanreuseitasoftenasyoulike.LikeanyVirtualBoxVM,itmaintainsitsconfigurationbetweenuses.

Thereareseveralwaystousetheinstalledtools,fromtheDockerQuickstartTerminalor fromyourshell.

UsingtheDockerQuickstartTerminal

1.FindtheDockerQuickstartTerminalicononyourDesktopanddouble-clicktolaunchit.

Theapplication:

oopensaterminalwindow

ocreatesa default VMifitdoesn’texist,andstartstheVMafter

opointstheterminalenvironmenttothisVM

Oncethelaunchcompletes,youcanrun docker commands.

2.Verifyyoursetupsucceededbyrunningthe hello-world container.

3.$dockerrunhello-world

4.Unabletofindimage'hello-world:

latest'locally

5.511136ea3c5a:

Pullcomplete

6.31cbccb51277:

Pullcomplete

7.e45a5af57b00:

Pullcomplete

8.hello-world:

latest:

Theimageyouarepullinghasbeenverified.

9.Important:

imageverificationisatechpreviewfeatureandshouldnotbe

10.reliedontoprovidesecurity.

11.Status:

Downloadednewerimageforhello-world:

latest

12.HellofromDocker.

13.Thismessageshowsthatyourinstallationappearstobeworkingcorrectly.

14.

15.Togeneratethismessage,Dockertookthefollowingsteps:

16.1.TheDockerclientcontactedtheDockerdaemon.

17.2.TheDockerdaemonpulledthe"hello-world"imagefromtheDockerHub.

18.(Assumingitwasnotalreadylocallyavailable.)

19.3.TheDockerdaemoncreatedanewcontainerfromthatimagewhichrunsthe

20.executablethatproducestheoutputyouarecurrentlyreading.

21.4.TheDockerdaemonstreamedthatoutputtotheDockerclient,whichsentit

22.toyourterminal.

23.

24.Totrysomethingmoreambitious,youcanrunanUbuntucontainerwith:

25.$dockerrun-itubuntubash

26.

27.Formoreexamplesandideas,visit:

28.

UsingDockerfromWindowsCommandPrompt(cmd.exe)

1.LaunchaWindowsCommandPrompt(cmd.exe).

The docker-machine commandrequires ssh.exe inyour PATH environmentvariable.This .exe isintheMsysGit bin folder.

2.Addthistothe %PATH% environmentvariablebyrunning:

3.setPATH=%PATH%;"c:

\ProgramFiles(x86)\Git\bin"

4.CreateanewDockerVM.

5.docker-machinecreate--drivervirtualboxmy-default

6.CreatingVirtualBoxVM...

7.CreatingSSHkey...

8.StartingVirtualBoxVM...

9.StartingVM...

10.ToseehowtoconnectDockertothismachine,run:

docker-machineenvmy-default

ThecommandalsocreatesamachineconfigurationintheC:

\USERS\USERNAME\.docker\machine\machines directory.Youonlyneedtorunthe create commandonce.Then,youcanuse docker-machine tostart,stop,query,andotherwisemanagetheVMfromthecommandline.

11.Listyouravailablemachines.

12.C:

\Users\mary>docker-machinels

13.NAMEACTIVEDRIVERSTATEURLSWARM

14.my-default*virtualboxRunningtcp:

//192.168.99.101:

2376

IfyouhavepreviouslyinstalledthedeprecatedBoot2DockerapplicationorruntheDockerQuickstartTerminal,youmayhavea dev VMaswell.

15.GettheenvironmentcommandsforyournewVM.

16.C:

\Users\mary>docker-machineenv--shellcmdmy-default

17.Connectyourshelltothe my-default machine.

18.C:

\Users\mary>eval"$(docker-machineenvmy-default)"

19.Runthe hello-world containertoverifyyoursetup.

20.C:

\Users\mary>dockerrunhello-world

UsingDockerfromPowerShell

1.LaunchaWindowsPowerShellwindow.

2.Add ssh.exe toyourPATH:

3.PSC:

\Users\mary>$Env:

Path="${Env:

Path};c:

\ProgramFiles(x86)\Git\bin"

4.CreateanewDockerVM.

5.PSC:

\Users\mary>docker-machinecreate--drivervirtualboxmy-default

6.Listyouravailablemachines.

7.C:

\Users\mary>docker-machinels

8.NAMEACTIVEDRIVERSTATEURLSWARM

9.my-default*virtualboxRunningtcp:

//192.168.99.101:

2376

10.GettheenvironmentcommandsforyournewVM.

11.C:

\Users\mary>docker-machineenv--shellpowershellmy-default

12.Connectyourshelltothe my-default machine.

13.C:

\Users\mary>eval"$(docker-machineenvmy-default)"

14.Runthe hello-world containertoverifyyoursetup.

15.C:

\Users\mary>dockerrunhello-world

LearnaboutyourToolboxinstallation

ToolboxinstallstheDockerEnginebinaryintheC:

\ProgramFiles\DockerToolbox directory.WhenyouusetheDockerQuickstartTerminalorcreatea default VMmanually,DockerMachineupdatestheC:

\USERS\USERNAME\.docker\machine\machines\default foldertoyoursystem.ThisfoldercontainstheconfigurationfortheVM.

YoucancreatemultipleVMsonyoursystemwithDockerMachine.Therefore,youmayendupwithmultipleVMfoldersifyouhavecreatedmorethanoneVM.ToremoveaVM,usethe docker-machinerm command.

MigratefromBoot2Docker

IfyouwereusingBoot2Dockerpreviously,youhaveapre-existingDockerboot2docker-vm VMonyourlocalsystem.ToallowDockerMachinetomanagethisolderVM,youcanmigrateit.

1.OpenaterminalortheDockerCLIonyoursystem.

2.Typethefollowingcommand.

3.$docker-machinecreate-dvirtualbox--virtualbox-import-boot2docker-vmboot2docker-vmdocker-vm

4.Useth

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > 自然科学 > 物理

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2