100% found this document useful (1 vote)
2K views61 pages

Docker Handwritten Notes

Uploaded by

Manohar Sankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
2K views61 pages

Docker Handwritten Notes

Uploaded by

Manohar Sankar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 61
Page No. oe be » (ae ey sepckery) Docker % an opensousce centralised platfosrn aesigrd 40 create, deploy and mun applicalion. Cockey uses containes on the host oS tO vuo pplices;, tt auows applications tO USe the Some Linux Kesnal as q Syskm on the best dempubrt ,talmes thon Cieaking a” Whole vittual 0.5. we can instau docket on 0.5 bub dockev engine runs poHVey on Linux dishibation joockes conten in * ge? Language fpocker fsa tool thar pesfooms oS. Level vistualis on jlso KNOus contedneritation - Before pockes | Mary USeES Fue dye problem imap a pasticsoar code is Bunning in the cleveloper’s opie (bab'net in the Uses’s System. Bockes COGS FISSt Seease in Maxch 2013, THis deeopal by Salomon HykeS and Sebashan Pahl jPockey fs a Se ob platform asa Serce pap uses OS Level Vittualisation cheney Vmaart USE Hordware Leves Vittioligvion , Akash KaleNe PFE AUCCatién ob Ram Conkineous Integration 7 bockes enanies you te build {8 cetaines image and use that seme image acvoss every SKe ob the deployment process 3 hess cost.) pes 15 THis lightoloc@e gt . Et fan tun on physical H/W / visruas Hjeo | oF on cloud . 0 si CIN, WELUSe - the mows. d | | T+ took Vewy dess “Hime teeiocsealerncentdiney . Dockes PS not 2 good SUGHO fer -OpPlicakes “that wequites feb GUT E DIF CUt to manage Large ammount. 64, Contetiney | 5) 7 i loockes does neat provide | CVSS platform — Compauibility means fb an application ?s designed te xen 19 a docker, [ebndehetx OR Csindaas-y (then Fh cany.c6Un analiauk ov Vice. VeNS® « IDockex £5. Suitable her He developrnent 103 andi teskin jos are.same If the 0.5 fs: chbbesish, OC Should tse vm. INO Solction for Data aecovesy and Backup .°Cockers Ecosysle "ox packages Se 6b ID ( [Pockew\ a [ Dockey cienk_f [_imoges \ compa ae ey \ a eee ce | [Sree | [a DOCKS eagiee | a | a ~_4 Dockes Doemmon pockex_claerdoa rans onthe hush 0-5) TH Ps wesponsi ble fow Bunning Containeys te manages Ljdockes. Service orwise [ is RA + |Wockes Caemon can Communicate with Gher: doemen Dockes ‘client be aad Bockey useys can fhtesact With FOC Goemen Hryough te! client Ccury t | Becker clienk\ uses Commend |... Lt and Rest AT 40 _cormmunicale with Hu docket doomon + [ene O. Cliend Bens En, sewers Aodkesiciient teamnal , Cl these docket: Command onte +e. Client Hemminal sendsfommends ts the dackey deemon fs Passible, for Aockes cient to Commanicale s0/th rox Hen one daemon @ | Cockes Hast Deckes Host Js used) te prehde on enviovonmens to | execute And Bu application T+ Gronbains the docker /__| daemon, images’, centainrs, Newerk ond Ststage- 3 @_| Docket Hub/ Registoy ie Oockes Begishy manages and SteseS the sockes images . hese @3t too types Ob seqistwies 19 te) dotkes . IG) Public @e gfstsy 3 Pablec hegisky fs also catled aS decker hub envale Re gists : 2 te Rs used te Shave images SYD +? sotermse | Dockes images an Dockers images ar the read .oply templates used to beatae dockey Containers. os Binalefire Couh au dependencies and Corfigu¥ation aquired to "un a program.(Page No. 2 class sqme ese __) Ti $122 LORS docker_ tf o Sofkioave /Tool spooky ate ape hips ose) Orson ota, — ~S t \ LOGO of DOcKER SGOHHGINES) 3 x Means one. comipwles Cnormat —ec2 instance] X_using docker tool we ceeale N-number o ; Sb _comainess ( Machine), Opesahing System Windowse> Uni: n __fin-soays. a bee ae Bem Ate ustog Sale t open sourecede J Linux Ob Unik Tot open dousce code. “| He > ox erealed Frys | MacOe a Centos, Qihad@L, tedor’, Obani al __Conted’nev $- A Container like a Vittual machine. 4] Dockey ¢- Dockery Isa fool fe creale tose virtual machine | took form shiping contefners. pockey Is & tool Geer fo mote Conterness th Which We can deploy any tpe % APPlicaien easily.[Pate OracdeVistual,BOx) Crrstuctisalion Sopksor€) =n speck l Vira a X_VSing above sobkoart | 1 BencePt ese Eeealed P-n008 \ masthine, €c2, compaky, J Laptop , sewer, *| one compute we mawe i} G0 PmulHple computes using Mituatisalion Softoore 1 a ne 0 awk ae apps oo icn x i Ge Cr AR Cr . SJ | spes' | gyn yuo 3 youn need to anocote | Rar 4 Hod disk , 05. Docker S/W as. 20! any favour Linux J HARDWARE 4 YOU Can Create any no _ a ij eb compuley thal is Hu x Ts gee te EP Pleribithy ob de ey - a AE! aS ye 6s T ’ Es BATS ccts cence Th Tre er 4 eh a) + K 08:1 pals cas & | feet ea Peirce | ee | tee] a Docket Softoaye : * 45° Bas® ml es gseo Unix) 7 how compaley f fo Ets nobused toy Ren L Horddisk fe cresting In ziJo Man: L * i CoM ad doc ex Covnrncir hy crealo,, Tinages o2% eee nay creatt_imad es % communi kept ah = s Lenages In) dockey hub, 2s] image jh) By usipg His Imdag OE Can crea : tear Ocentainer | Doceey Conteaney “ocuey omy - Fo Mp space. oie | OS Level VixtulizaR od es —lusedi-g sxe os out base moar REPS pp do@Aload fam’ dockeyhub: (Deployment _). Contain ef oot _dupeodent UPON base maine,Faoonelass 2B = = soloed Sea orev & ry fontaine’? 7 Folde He yes step @ Ue | Beale Contain’ by acing ireagt cnewly Ceaked D ect usev) f docker hun Hite -=Pame. haviconbioer saiimage __/ bin J bash | i J neo Thee One eae Skp = . ~ GDd__ehich tee containers 7H twonich Hee 4 J Bree : 19 ‘ : (DI contedney s/o] Wich Apache step . @|__continex 2 | H IS Sep a ie inp step a” = : ! _(3)|__ container _¢ JH ts tmp) ‘1 my file i Cnjainer?/ Ped mp7 hoy ae conieiney ¢/imp # 1s 4 £12 Z Jee (a ae korpaner 2 /impd cd - g Comoe s/f Contoiney 3 | eait exit Sts witcahD Corned nee | oaTy O. l ckefGiie | — i oo: eof _ sais (os¢ ==) | SockexGle ¢ ss * A tert Ge _with Inshadions to bald @n image 1 Auhopaion \a Docker Trnage Creation 2 Ron RUN 2 emp SHpd + Create a File Nomed | DockerHie» Srp2 3) Add ¢nshuction in Dactev fie: Sp 3 2 Du ild dockertle te Cate jmage SHPY 3 gun moge FO cre le container -Dockesfile Psa bascatly a txy file Ph contains some Sek ob insHu chon. Auboroahon.ob docker image ceealion -8O.cKE Components j FROM -y fers base image This Command must be on ' top oh the dockesfile . | RUN —y TO execwe Commands, it Gill Cseale a layer invimaga . & MATNTATNER yo AWthox Jownes o/- Descmption Copy 7 COPY Files feo local SySkm _Celodres_vm) Coe need to provide, source’, slesHination Cwe cant doenload Gite fem _intemed and any Denmoke p60). ACD -7 Silay to Copyo bey iH pyodes Q feture to downlodds files fons internet 5 alSd Oo ertvad Files ae dockey image side EXPOSE TO PrPOse POSH SUCH as POXE BOO HE +0 Mrcatk i POS Qo fir nginx ek. WORKDTR ~7 To: Se. Goasking divectivy fir a _ContcinePoona ay Moos Teal Spur domng Container yerber core rd Se oee aires Za os ieee ExecuLe commac= See ee oerene: a 2 “aes sas en a ceeibsibak has. ise Tz Binilay to 6 a hey lenteyrornT —7 _Sinvlay Tay S_highey nen eet Oo? eae [eae ees Sisters Axa crmrands Tegripha, exeraed "bys ___ Riva} @mmends sy EntaypornT 60 [Env —9 — Envicsnment anaes: 5 ppgmi send es) ea [ad arom anon) ait | Geeale a file named _. Bockestile 27|_Add_Tosteuction fn BockesFile SB] Bui Jol_d ochesFi le ~ to coeale image uy, Run image +0 create container ian Po pockesAle ¢ LE FROM, Ubuntu 4 PERU N eth $6 TeStRlelnipof bre | Estee US worrotR /émp i ENV mynome _Cname) Cory: bestfiled »/ Emp ADD» os*Shadovagz} Op a raanapA ATOQ Ter TO Cseate image ouwob decker fle P dockes build - +4 Chroage: name ) dockes ps~a 4 dockes images J Verby Now (seals Containey frm the abore image, pf dockey sun -it —~-name (canfaineename) Crragename) bio lbash Soir 2 © Akash Kaleeca-uses ] # IS no ie ee ust VITO BockerGres coremand_liee mod psess } bulla’ ~ Giveinskiu chon” 4 ere ® (From ubuntu {any os} \ we @n used ; | RON echo et Ht Sa’? ‘trop /test Fle 4 Docker Fg RON apj~geli Updale —y [eon apt-get insta tee —J | A Press ener J a j Chea) 5 Cleorang. pre scsey = es} Goteiney - Backer Fi — O5-ubuoha As LestFie Hy} sai (eR image a Aen image Cos+ Pile +5) w) = =i she @_eco-user JH dotkev bald —-t test - i |@F aca leser ] A docker imager a = a Seen Images =} 7 sie. ©] em-usev]y dockey run it ——Rame test centainer “so stesy bin/bash, skp 2 enter @D|_containes 374 Is Ske 1 (Q|_tontainey 3 FA Istmp 4testFile —SHe! 1 a (Dl Contaimes 2 fA eit . Cait 3 phd J modification. Ske| same doctey File (S) ea —yser] H Vi dockerfiie |, " 5 a epee A y redo na Z Delete His last Hae ~Cmodibication 5 (Feo ubunte york DTR 7 tmp RON echo Pens sai? pitmp lt este ¥ EW ny pame hot copy best hie Lemp App Lest * tor. az (Add = weove+ copy) 7p[exene (Sees po Botkes tt demo Conkai ner ( pe — ae ene petkie a \ : TRE Create te ae. Deal FestOut pez ECD esc fF wa ah enter Seu | ecoruwsev} a's *| poctey Hye Skepta] eco —usev] # touch Lethe 4 Step l3]|_ ecr-usev yg 1S "| Mockerf je testOiled 5 Shety pe ca —usev | J} douch test Sheps e2 -tses Da 1S 1 ‘ SKI nockey Ge “test testhile et ecr~ USA] A OW Vee | EOS tow gz enue] is Hockey He £est LOSE Wt eesk -tOK y4z _siel * | ece-usev) # \dockey bald = +t demd, — 94 7 = =U Ncesbaty BOW image sue 1g A x | ecr-usey}) H dookev images Akash Kalear pao cee | shp20!|ece-usey J # dockéy Wun -it —- 7GmMe, demo Contain demo! Pbin | bash © Syp2it_ Contoiney 3 | tmp # Is test tesiGle ted Filer SHH Contdiney. @/tmp # Ocho, $. myname [Rae sHkast\ comfein er: ? /Lrop Feat Fes bile \ Hi sar 5 Coptre} #E {eaeen = atume fsa simply a_divectouy inside cur Containers Fishy we hove to deddae Ths divectory a6 4 volume aed Hn Shaxe volume Lard Hun Shave Yotumé Evers If ¢ Sinp (uileinet, Sil ie can access vellurwe Volumes. Silt bec cpeaied io oe con}aney WOH CetnncelORG 4 cofnenteny, af ;a.¥elaqoe Only hile. Creating Oontoiney wou cont creat volumes Gem exfsiing conteines Meu Gin shane one yvelume Gerest Sey AGmbay ob Containess ceeate a Dockesfije and Ole insKuchon . Vi Oo ckenfile ius _ FROM “ubdntu.. = 1 VOWME Let /myvolume ” 7 Ther create image from this docker file, oagenar) docke% build —t.. My image NOW Chea. a scombainey frm HVS Image ¢¥4n ir d* dockey Fon it = =nome ((onkdnethame) Cimage name) [bin | bashsus aoli das, Ieuvle wou can, See » Mayalume JL ae “Now do Is , NOW ShASE VOIUME With Annes containerDocker file + Cveare one doctey Fle [0s (uburts)) -fromdo delle isan te Geate One image. Es 04 Cond nee i ee Tc i — [sa Actaly) Seheran 4 srepa:] “S$ Sudo su y sree Sernmerts [sepa ec2-uses } y Sewvice dacker Starus, | by debut ? Adive £ naa re . 2 pyre ‘sueg:| eco -use] 4 IS oe Se Doderfile tested “kest tor az Fupaei | weit] ernuset] HVE Dockers Ale \__ Dwant to chacge ——— =z Fs docket press f bulton ue eeaaa a Rony ubsotu pie SSP { Volum e{'/data”) (msn eres iS St we a e. eeatmage LL Steels: u. Oca uses Jy dockes build” — & moytrng > 4 : = ria Sie iL successbutty Ce have + created image LL SHett ) : \ J vesby IL C-USA] H dockes Wage 4 ‘i ] " it Seco dt Wing myimage, Gco-usex] 4 dockey yun -it 7 Pame Mycontt raging J bin / bash 2394 3\ Steds Conjainey g sp]. t Je Serr yorurne; = a3 rea wet Gay) ee 4 Trstead of clivectory SS Se Ke eontcinet 2) A ed dabal : cadena Be Seu) conlel nev c/o dake Jo~S __ B3 dhve : skett: contal dey 2 Adore gt org)! Vise te 3 re touch hE _Ste8t_contamet 8 / dda Hols | dg 4 q myfie J say a a sHely si exit y , : iBir my IX TL Sook te Create, my conta reberan feo harey rojpent., E [aelst| ecamuser) at dockew run —fe —>pame Mmy.cooh.2, Ecprwiltyd. —volumes-fam Ubuntu /bin J bash eon gs TY Conf J -enterm Guecessheuly Created rey cont 2, sess] Conlapet 2/4 [5 , Bota br idey— =o =o = apy 5: ious sete] Contaloey 2 / H exit Another File cyveated xd - 10 My Container ak t Pe Fest ae t atted Volume map. pesay corfaunet ar€ exited oY ster joy _ See] @cr sev] H dockey PS—a a iy cont wal 4 a : | sreigt] CD -USeY] H dockev Stay Mmyconta | roy cont : E eae pase Te docKev PS conteiney Aebai ls het 7 read ea uss) a dockev tach myConk t d Containes + fa Is a cheater a| ; Seer Contaioey 27 YW is dda / | L roybile Resin : Container 2 yg et pol ertaled iy Wik eal A) SP locs sex 1H lackey shart moycond 2. spree step Payconk 2 : She? cy sev | H dockey abtach taylor 2 = L j __skpas}oonteiney oe] # Cd daka / aL sup: Container pf dala#t 1s jt | a \ [PPR wokiney = [aaagtd dada a toach Ket __ Stipa: eoeone’ gf uala HIS boy ie + _Skp2af Contoyhet @ (dale gi end t erik. Staxt Contd ‘| (+ Pp. ea -uses} HH docker stavt_Mmyoont 4 — a a T theNolame ease” # dockeY ahach mycont tl b ‘ Conteiney = JH Is dees, aia ie test Ls yo 3 pS ey sg Sconmainey 2 / # exit | en ont | 1 t ghet Confubner te ae cine PRY W a ea ee eetue volume —Fany Containest Ubante [bin Jiga/ a touch /™MyVvalume t | SompieFile 7 dockey Stat} Contained 7 docke¥ attach Contalney 4 7 IS/ myvoturne L hvo® aptes ' pseating confainey 2.) my volumel is visible, Whakeves you alo “In one Volume, “can: See Pers “othey |, a Yolums - | 7 A vou can S¢e SompleFile pose > exitsteels: Sca-user] dockey Yan it =-Pame Hy cry =v [Saf ubuntu /bin) bush seat] Comaloey s /# Is b } a SHPSST Conkunet @ [Ht cd Sat / Sex] Contuiney g S Sai # touch Same orn container 9 (SUH IS say GiJe E 2 supats| container 8 /.cai # Ot eid TOG 10 Geale on? OTF py amy ACBL TF ge Bann aeberance SHp3$4 eco -sev } ! z Sao eer ental baa ariel a =-Wlume -hrom g Ybundy _/ bP ) bash Z ae enycond. ie SURRY tae Rave Creabed comeciney ven by J shod =) Coteiney 2 /A 1Sjo. safe Confainey Po Conserve Race gti E Shorey welt: [oman em = Gatie) sket: container 2 / de )S Sa — al Eye, = Li sesh: Concer 3 / ft touth Sai shanble ontainey s fH Is sa / st ase havfile sd Ge Ske4s: Consedey 2 / Hy enit i xi} —4 stent Coot3 i 4 LU Seen =uny at deka tot Myconty a t POY Conk docker - 2 | | . sxe] Cer -USer] A dockey atach 3 Conk3 4 . skp]: Comtuiney zy His | i i — Adwe aden i skp i habe Saiaye re | Les: ¢ Jainey_e a 1 pid t ee t »& “ dockex gun -j+ Mame Conlainex3 —Vv /Volumer ubuntu bin/bash‘ + £0 1S 7 cd fvdlumer © “NO Ceeale one File “camteineyS File And exit NOW Create “one Moye Crottiner’ “yand © Shar | yom instau -dechew -yt —> | Sovice docket status ~7 |Ssewvice dockex stast \ cote =, doclhess wun -td -~hamé fecnsewerr —P 80: Go bury T daemon host Camariachid mae 7 | docker PS 7 | deckevy poyt (techsere sy name oo * ye 3 eopTer 7 0107070 / go —7| dockes exec -Tt _techsrave / bn /bash 7; apt-3¢ gpdale —7| apt-ge instaw Gpachen ~J 7] cd Vav/ www/ html Index: html echo ©& This Ps docket port File”? SPMACe apache 2 Stast decker BUN —td —-Mome Myjerkins ~P BOG: fog Jenkins* Cont conte. Stousk Instore 2% OD spe % ER MePEINs With cont” Step! | ~ TF sutosa Shpall @ceeUSeY]H dockes Images Skps:| eca-uses) HM Gervice docket Staus —— twice 1s awe dy Tunniny Shpis| CC2—USSY Gy qacker ps5 a : tae Q_ ast contoiaers Show ae J Skps:| eco-usev JH dockev \ PS | only shoo merring) conn oY Sle st ‘ * | eco-usev] A cbcker wn -€@ ~-Mame Websnver —p > G ver eo tbuotey bP 2 @td temninal dedencbed) BS \ a a GLa loi adiee tendad, pod pon entry rok inergeding 42 cont. 2 Td Why td aed : “ahlnshs Ne 4 site Lhash = ‘dent! Yank to €tteg. ang olde ‘ aint arts Vbeed Si Has nad,Shel eraser] of _dockes PS _y aaIK. THOT”? puragaM 7 Se Conjainer Dekel! websrvet Thal ecaase) docker ened, Lik [bebsewen’s/byp/ bad Ee Ontainey webserver, 2 / | - 7 2 s —_ waa] @OtineW Td sapi-ge update ~J 4 a J i Sdoent x insta t sepick Condalne® 7 | A api-gee Insta! apaches “iy fa Scleak_Oaagia pet cl Ades select Tie OCS vrok spl: Bone + containes i / A 1S wna Wor) an suepl] camkinex 2 f HC Zor Pt sp! cmtomey 3 A Vor LS ah-y , Sane Bs os Seppe? Contesney so. PVOr HAH Cd Www/ Supidi —Contdines: [Vax [Awww # 1s Keral 1 peed “Serif: pOntemey . iL yar (Www #, ed htm] “spit: 7 tontednen & fvan sw / henol 4D © YG Bebank dake orcon teinee oe PSS conasney = [vax] Www] html # echo SS Hele Dose 2 ‘Sup lB: hows html. > supig] conbainey ¢ [vay(/wwe/hool H Is has html index «html : ecr instunre pOXt Shedd chooge x container port not change. ske?:] Comanet = /Vvarlwwp [htm ocd [det E sepu| ——j— + /H exit exit | she2| eco-user ] 4 dockey PS \ I mrunning Container swimaye IS q pubde image, L. $0 Gay one Can Put SHPIS. Jar Tage | ‘ fe | Songs = 4 i. Ww seeps) Ecz-useY ] # dockey pPS-q 1 * Container detuls 5 Pa remove Cotather |e C2-Usey) qf docker sk Taran conhainey Ste I : tapah conteiney_.Qcr-user| 4 dockey ps-a- 4 Bix ama frheye, containey © SePl9: @er-uset] A dockey Images, i , 7 @ ===. saljnonge ies see ecr-usev] # docker Ami henbascs|netsetimege 4 Seer, eca—useY | H dockev images 4 Can pot see” amy imnages Sepia: err UY | Ht dockev, PSA | You can pet See any Conteiney = . we boed tp punt pv ale Image. Srephe ‘ = @c2-usey\ 4 dochey POU haw 25 65 J new FW irray - ~enpene + oo ay cl) SHPMK g cx-user | docket login soon anne PASl Lo d His clean Login ‘successeded 5925: = ec2~usey) 4 dockeY Pu hom Ises/ Hew Seu imagg poland, O0e0n Joad Complele. —Seee ds Baer pipositar 07 Ly ceing 7 Delele reposiieyEE Page No, 423 : ? 7 Ld es pst pd eo cee SOP $ Corker psa i) Tee ofp Succe - uecessbully Shep. noire yarn ore AGNS' M95 “roa pemove al contemer : ec2-usex)] docket ym B Cdoskev ps -a -4) fi 7 Seeryharog webave delete — a | nerve aut _ismaye. L secondly ate mers ecr-user] y dockes mi. ~F_$ Cdockex, Inoages. -L) Commend. Pererng ao por Tage : vedby i= dodker inmagos/ decker “p 8-0 | ( Eovoredod )Goto Aws account 7 Select Amazn unc Now go 40 pully —7 Login as — ecr-usee 7 = ee Sudo Su A Yur updale ~y yun instal dockey -¥ Stiace dockey Statf \dockes vrun. iE ubuntu /bin/ bach NOW Create Some Piles inside Container Now Create image ab dais Contador deckex coment, (Contdinet name ) (imayerame) ConkineyL THaset NOS Cseake ccecunt in hub: decker. Com Now got EC2 jnstance dockes login, enkey wouy Usesame € Passouid jive tog te your imaye Noo giv 3 yew y —s ‘ont dockey tag imager dockevid ] newimage Nprjet docke% push alocttev id / newimage, Now you can see Hus image 19 dockey hub accouo} NGw Create one IStance wn PHY Sesion and Baey mesge Ferme hub.Var Aa eT 9 pacer so naetnnwtbne ind -aispy |} dockes part) cdockerid | neoinnaye, Got se cot dockey cum -it ~7MOME — mycon}ainay- So dockerid /new@lrmage bin | bash|docker Volume 15 ldockey Nolume: Create iX volume name dockes Volume hm Hocke¥ Volume Sd0e (Tt semmoved. al. unused docker Volume) Odkey Volume inspeck

You might also like