您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 项目/工程管理 > the-docker-way-v2
TheDockerWayxuli@qiniu.comAgenda•Docker:What,WhyandHow•Story:WhenQiniumeetDocker•Q&AContainerizationisthenewVirtualizationWhatisDocker•ThesameseeandsharedforeachLinux-process:•LinuxKernel•FileSystem•NetworkSystem•PID,UID,IPC,etc..•Memory,Disk,CPU,etc..BeforewelookintoContainer..andalitaboutVirtualization•Isolated:•FS,net,pid,uid,uts,mnt,ipcnamespace•Constrained:•Memory,CPU,NetworkIO,DiskIO,DiskSpaceTheprocessgroupsthatmeettheaboverestrictionsarecalledlightweightvirtualmachineorContainer.Ah..Hmm…Soundscool!Butisn'tnewyet?HardwareLinuxKVMLinuxKVMLinuxKVMLinuxKVMLinuxVirtualMachinesHardwareLinuxContainersContainerContainerContainerContainerContainerContainerContainerContainerContainervs.VMContainers are isolated, but share OS and, where appropriate, bins/librariesApp A !!!!!Hypervisor (Type 2)Host OSServer!!!!Guest OS !!!!!!!Bins/ Libs !!!App A’ !!!!!!!!!Guest OS !!!!!!!Bins/ Libs !!!App B !!!!!!!!!Guest OS !!!!!!!Bins/ Libs !!!VM!!!!Guest OS !!!!!!!Guest OS !!!…result is significantly faster deployment, much less overhead, easier migration, faster restartApp A’Docker Host OSServer!!!!Bins/Libs !!!App A!!!!Bins/Libs !!!App BApp B’App B’ContainerApp B’!!!!Bins/ Libs !!!App AOriginal App !(No OS to take up space, resources, or require restart)App Δ !!!!Bins/App A !!!!!!!!!Bins/ Libs !!!App A’ !!!!!!!!!Guest OS !!!!!!!Bins/ Libs !!!Modified App !Copy on write capabilities allow us to only save the diffs Between container A and container A’VMs Every app, every copy of an app, and every slight modification of the app requires a new virtual serverApp A !!!!!!!!!Guest OS !!!!!!!!!!Bins/ Libs !!!Copy of App !No OS. Can Share bins/libsApp A!!!!Guest OS !!!!!!!!!!Guest OS !!!!!!VMsContainersWhyContainerslightweightDockerArchitecture(before1.x)LinuxKernelCgroupsNamespacesLayeredFSLXC(LinuXContainers)DockerTechnologyStack•Containerformat!•RunsonmostLinuxdistros•Boot2DockerforOSXandwindows•UsesLinuxKernelfeatures•StorageisprovidedbyUnionFilesystemsWhyDocker?TheChallengeStaticwebsiteWebfrontendUserDBQueueAnalyticsDBBackgroundworkersAPIendpointnginx1.5+modsecurity+openssl+bootstrap3postgresql+pgv8+v8hadoop+hive+thrift+OpenJDKRuby+Rails+sass+UnicornRedis+redis-sentinelPython3.0+celery+pyredis+libcurl+ffmpeg+libopencv+nodejs+phantomjsPython2.7+Flask+pyredis+celery+psycopg+postgresql-clientDevelopmentVMQAserverPublicCloudDisasterrecoveryContributor’slaptopProductionServersMultiplicity of StacksMultiplicity of hardware environmentsProductionClusterCustomerDataCenterDo services and apps interact appropriately?Can I migrate smoothly and quickly?NxNcompatibilitynightmareStaticwebsiteWebfrontendBackgroundworkersUserDBAnalyticsDBQueueDevelopmentVMQAServerSingleProdServerOnsiteClusterPublicCloudContributor’slaptopCustomerServers??????????????????????????????????????????AnInspiration..andhistory:CargoTransportPre-1960Multiplicity of GoodsMultipilicity of methods for transporting/storingDo I worry about how goods interact (e.g. coffee beans next to spices)Can I transport quickly and smoothly (e.g. from boat to train to truck)Alsoamatrixfromhell??????????????????????????????????????????Solution:IntermodalShippingContainerMultiplicity of GoodsMultiplicity of methods for transporting/storingDo I worry about how goods interact (e.g. coffee beans next to spices)Can I transport quickly and smoothly (e.g. from boat to train to truck)…inbetween,canbeloadedandunloaded,stacked,transportedefficientlyoverlongdistances,andtransferredfromonemodeoftransporttoanotherAstandardcontainerthatisloadedwithvirtuallyanygoods,andstayssealeduntilitreachesfinaldelivery. of StacksMultiplicity of hardware environmentsDo services and apps interact appropriately?Can I migrate smoothly and quickly…thatcanbemanipulatedusingstandardoperationsandrunconsistentlyonvirtuallyanyhardwareplatformAnenginethatenablesanypayloadtobeencapsulatedasalightweight,portable,self-sufficientcontainer…ThiseliminatedtheNxNproblemStaticwebsiteWebfrontendBackgroundworkersUserDBAnalyticsDBQueueDevelopmentVMQAServerSingleProdServerOnsiteClusterPublicCloudContributor’slaptopCustomerServersBuild,Ship,Run!!!“buildonce,runanywhere”–developers“configureonce,runanything”–operationsWhatcanIuseDockerfor?•ContinuousIntegration/Deployment•Packaginganddeployingapplications•BuildyourownPAAS•DeployapplicationsathyperscaleDockerBasics•Image(andLayers)•Container•Registry(like)Images•Imagesarethesourceofcontainers•Everycontainerislaunchedfromanimage•Imagesarebuiltandlayered•ImagesarestoredinaregistryLayers•Eachimageismadeupoflayers•LikeLinuxthebottomlayerisarootfilesystem•Dockerusesunionfilesystemmounting•Toplayeriswriteablea
本文标题:the-docker-way-v2
链接地址:https://www.777doc.com/doc-4917209 .html