《容器镜像的备份及恢复方案.docx》由会员分享,可在线阅读,更多相关《容器镜像的备份及恢复方案.docx(8页珍藏版)》请在优知文库上搜索。
1、ENVPKGRE1.EASE1-bmterRUNset-xcreatengnxusergropfirsttobeconsistentthroughoutdockervariantsH(Uddgroup-system-gid101n9inxEthadduser-system-YrsabM-IogM-ingroupnginx-no-crwtt-hofnc-home/nonexistentrecos*,nginxuser*-shdlbool.sks-kcy5cfvcr5.ncthkpJZkeyKrvcrubuntuem0hkp80.pool.sks-kcyscrvers.ftttr80p9p.mit
2、du:doechoFetchingGPGkey$NGaNX_GPGKEYfromSswapt-keyadv-keyserverSserver*-keysetver-optiomtimeout*10ecvkeyseSNGINXGPGKEYwHafound三ycsHftbruk;donc:tot-zSfoufxttttechott211x:fadtofctcGPGkeySNGlNX_GPGKErHttexit1;APtretremove-purge-XKxemovt-y9nup9lHHrm-rfvarfW)ttaaftdpk9Arch-vS(dpkgfictarChiteCtlXftftn9inx
3、Pdu9e5*n9inx-SNGINX.VERSION|.$!PKG_RElEASejngmx-fnodulc-xsIt-SNGINX_VERS*ON$PKGJEIEASECgmX-modulc-geoNSNGlNX.VERSION)-$PKG.RE1.EASEngnx-module-imgc-filter三SNGlNX_VERSIoN)-$PKGRE1.EASE)ngmx-module-nSNGINXVERSION.$NJSVERSION)-$(PKGRE1.fAswHftcSdpkgArcbeinM11d64i386)9archesOfficialybuiMbupstreamechodeb
4、httpsnginx.orgkagemainiiedebiarbust。nginxetgpt0urmJitd119ExJist&apt-getupdate11)wereonMarchitectureupstreamdoesntoffidllbuildforfIctSbuldbinariesfromthepublishedsourcepackagesechodeb-vchttpi/nginjuorg/padogn/mianline/debian/bu%ternginx-/ctc/apt/$ourres.li$t.d/nginx.list# newdirectoryforstoringsource
5、sand.dcbfilesftfttempDir=S(mktemp-d)-Etachmod777StempDir# (777toensureAPTs_aptusercanaccessitt)# savelistofcurrently-installedpackagessobuilddependenciescanbedeanlyremovedlaterEtftsavedAptMark=S(apt-markShowmanual)# build.debfilesfromupstreamssourcepackages(whichareverifiedbyapt-get)EtEtapt-getupdat
6、eEtEtapt-getbuild-dep-ySnginxPackagesaa(cdStempDirEtftDEB.BUI1.DOPTIONS=nocheckparalld-$(nproc)Napt-getsource-compileSnginxPackages)UWedontremoveAPTlistsherebecausetheygetre-downloadedandremovedlater# resetapt-marksmanuallistsothatpurge-auto-removewillremoveallbuilddependencies#(whichisdoneafterWein
7、stallthebuiltpackagessowedonthavetoredownloadanyoverlappingdependenn)Etftapt-mrkshowmanualK3rg%apt-markautoknu1lftft-zSuvcdAptM3rk*t-markmanualSuvedAptMark;.createatemporarylocalAPTrepotoinstallfrom(sothatdependencyresolutiononbehandledbyAPT.asitshouldbe)ftftIsMAFheStempDireftfcdwStempDir*Hftdpkg-Sc
8、anpKiuigcs.Fckgft)HHgrep-Pc*j9e:,StempDirPckagesftftecho-dcbtrustedyefileStemPOirfetcaptSoUrCWJiSt4ftugi“workroundthefollowingAPTissuebyusingAcquire:6ZiPlndexes*f(overriding7etcapp1.conf.(Vdodcef-ip-i(kxes*)“Couldnotopenfile/var/)it/apt/)isb/partial/.tmp_tnip.0DW1jpQfk_._P!KUges-open(13:Rfrmissionde
9、nied).E:F4cdtofetchStOreMm岫pt1sW叼)ODVjpQfk_,_PcU9Couldnotopenfile/vM/lib/apt/lisWpertial/_tmp_tmp,00W1)pQfkE_._Pdu9CS-open(13:Rwmtssiondenied)Wt叩QFet-oAcquirt:izip*n(kxcsfal$eupdateesacEtEtapt-getinstall-no-istall-recommcnds-no-istalI-suggests-yJnginxPackagcsgettcxt-baHEtapt-getremove-purge-auto-rem
10、ove-yCa-CCrtifiCateSHHrm-rfvarlibaptlistsetcapt$ource$.list.d/nginx.listifwchavleftoversfrombuilding,Icfspurgeth-wfldhello-wofldIateKfce289e99ct9ISmonthsago14kB ,保存镇金至文件 dockersavehello-world/daHhegwori&imige.ta1.JCdM3JhIgrephclk-world-ifu9e.tar4z“期除UIB dockerrmi-fhello-worid:latntUnta99cd:helkwor1d:UtestUntagged:helkHwodda2S6dfddf63G36dMef479d645abS88S1SO3(X611aS6f337ac7f2fdd86d7e4eDekted:sha256