神不在的星期二
在centos7上我们可以通过yum来安装docker1.确保你拥有管理员权限,需要可以使用sudo或者root的命令的权限。2.需要将你的yum的包升级到最新的状态。sudoyumupdate3.为你的yum添加一个repo文件。在centos7下面您可以直接运行下面的代码。cat>/etc/yum.repos.d/docker.repo<<-EOF[dockerrepo]name=DockerRepositorybaseurl=pleteStatus:Downloadednewerimageforhello-world:latestHellofromDocker.Thismessageshowsthatyourinstallationappearstobeworkingcorrectly.Togeneratethismessage,Dockertookthefollowingsteps:1.TheDockerclientcontactedtheDockerdaemon.2.TheDockerdaemonpulledthe"hello-world"imagefromtheDockerHub.3.TheDockerdaemoncreatedanewcontainerfromthatimagewhichrunstheexecutablethatproducestheoutputyouarecurrentlyreading.4.TheDockerdaemonstreamedthatoutputtotheDockerclient,whichsentittoyourterminal.Totrysomethingmoreambitious,youcanrunanUbuntucontainerwith:$dockerrun-itubuntubashShareimages,automateworkflows,andmorewithafreeDockerHubaccount:/userguide/如果看到这样的命令就说明hello-world的镜像安装好了。这个时候我们再键入servicedockerstart就会提示Startingdocker(viasystemctl):[OK]说明我们的docker已经正常的在centos上运行了。