(This page has no text content)
Docker A Comprehensive Step-by-Step Guide for Beginners
TABLE OF CONTENTS Introduction 4 Chapter One: Understanding Docker, Containers, Images and Dockerfiles 7 Chapter Two: Setting Up and Testing Docker 25 Chapter Three: Containerizing Applications, Deploying them to Kubernetes and Swarm, and Sharing them on Docker Hub 64 Chapter Four: An Introduction to Networking With Docker 94 Final Words 124 A
© ACopyright A2024 A- AAll Arights Areserved. It Ais Anot Alegal Ato Areproduce, Aduplicate, Aor Atransmit Aany Apart Aof Athis Adocument Ain Aeither Aelectronic Ameans Aor Ain Aprinted Aformat. ARecording Aof Athis Apublication Ais Astrictly Aprohibited Aand Aany Astorage Aof Athis Adocument Ais Anot Aallowed Aunless Awith Awritten Apermission Afrom Athe Apublisher Aexcept Afor Athe Ause Aof Abrief Aquotations Ain Aa Abook Areview.
INTRODUCTION The Aage Aof Avirtualization Ahas Adone Aa Alot Afor Aallowing Adevelopers Ato Abuild Aand Acreate Afrom Atheir Acomputers Aas Aif Athey Awere Adifferent Asystems. AVirtual Amachines Aallow Athem Ato Acreate Aentirely Avirtual Aoperating Asystems Awithin Awhich Ato Awork Aand Abuild. AThese Asystems Aare Aone Aof Athe Amajor Aways Athrough Awhich Aa Ahomogenization Aprocess Ahas Abeen Aable Ato Aspread Athrough Athe Adevelopment Aworld. AA Adeveloper Acan Arun Aa AWindows Avirtual Amachine Afrom Atheir AMacbook Ain Aorder Ato Atest Athe Afunctionality Aof Aan Aapp Athat Awas Adesigned Afor AWindows. AIt Ais Afar Acheaper Aand Aeasier Ato Arun Aa Avirtual Amachine Athan Ait Ais Ato Abuy Aa Awhole Anew Acomputer. Yet Aeven Avirtual Amachines Abring Awith Athem Atheir Aown Aset Aof Adifficulties. AThere Aare Amany Afactors Awhich Adetermine Ahow Aefficient Aa Avirtual Amachine Awill Abe Aon Aany Agiven Acomputer. AThen, Aon Atop Aof Athat, Aeach Acomputer Auses Adifferent Ahardware Alike Agraphics Acards Aand Aprocessors. ATwo Adifferent AMacbooks Amay Aeach Abe Aable Ato Arun Aa AWindows Avirtual Amachine Abut Athe Aunderlying Ahardware Ahas Aa Adirect Aeffect Aon Ahow Awell Athe Aapp Ainside Athe Avirtual Amachine Awill Arun. ASo, Awhile Avirtual Amachines Ahave Astarted Aa Ahomogenization Aprocess, Athey Aare Astill Afar Afrom Acompleting Ait. That’s Awhere ADocker Acomes Ain. ADocker Ais Aa Aplatform Aas Aa Aservice Aproduct Awhich Auses Aoperating Asystem Alevel Avirtualization Aso Athat Ausers
Acan Autilize Asoftware Ain Apackages Awhich Aare Acalled Acontainers. AEach Acontainer Ais Aisolated Afrom Aeach Aother Aand Aincludes Aeverything Athat Athe Aend Auser Aneeds Ato Arun Athe Asoftware Aon Atheir Acomputer Aregardless Aof Aits Aspecs. AThey’re Amore Alightweight Athan Avirtual Asystems Aand Aremove Aa Alot Aof Athe Aguesswork Afrom Athe Avirtualization Aprocess. ASince ADocker’s Acreation Ain A2013, Ait Ahas Abeen Aused Aand Aexpanded Aon Aby Acompanies Alike AMicrosoft, AGoogle, AIBM, AHuawei, ACisco Aand Amore. AIn Afact, Athe Ause Aof ADocker Ais Aspreading Aso Aquickly Athat Aan Aanalysis Aof ALinkedIn Aprofiles Ain A2017 Ashowed Athat Amentions Aof Athe Aapplication Awent Aup Aalmost A200% Ain A2016 Aalone. So Amany Apeople Aare Afinding Athat ADocker Ais Athe Aperfect Atool Ato Asolve Atheir ADevOps Atasks Athat Aits Acontinued Aadoption Aacross Aindustries Aand Aspecializations Ashows Ano Asign Aof Aslowing Adown. AChances Aare Ayou Afound Athis Abook Abecause Ayou’ve Aalready Aidentified ADocker Aas Aa Apotential Atool Afor Athe Aproblems Athat Ayou Aface. AThe Aaim Aof Athis Atext Ais Ato Agive Abeginners Aeverything Athey Aneed Ato Astart Ausing ADocker Athemselves. ATo Aachieve Athis Agoal, Athis Abook Ais Adivided Ainto Atwo Aparts. AThe Afirst Apart Ais Athe Aexplanatory Atext Awhich Ateaches Ayou Athe Aconcepts Aand Asteps Athat Ayou Aneed Ain Aorder Ato Ause ADocker. AThe Asecond Apart Ais Athe Aexercises Aand Ahands-on Atraining Atasks Awhich Aallow Ayou Ato Aget Astarted Aworking Ain ADocker Ato Aput Awhat Ayou’ve Alearned Ainto Amotion. AThese Aexercises Awill Abe Aspread Aout Athroughout Athe Abook Aso Athat Ayou Acan Aget Aright Ainto Athem Aalongside Athe Arelevant Asections.
The Abook Ais Abroken Aup Ainto Achapters Awhich Aeach Afocus Aon Aa Aspecific Aelement Aof ADocker. AChapter AOne Aexplores Amore Aof Awhat ADocker Ais Aand Ahow Aand Awhy Ait Asolves Athe Aproblems Amentioned Aabove. AWe’ll Aalso Alearn Awhat Aa ADockerfile, Aan Aimage Aand Aa Acontainer Ais Ain Athis Achapter. Chapter ATwo Awill Atake Ayou Athrough Asetting Aup ADocker Aon Ayour Aown Acomputer. AThere Aare Asome Akey Adifferences Ain Ahow ADocker Afunctions Awhen Ait Ais Arun Aon ALinux, AWindows Aor AMac Aand Awe’ll Asee Awhat Athese Adifferences Aare. AYou’ll Aalso Arun Ayour Afirst Acontainer Ain Athis Achapter Aand Asee Ajust Ahow Aeasy Athe Aprocess Ais. Chapter AThree Awill Acover Ahow Awe Acontainerize Aan Aapplication. AThat Ais, Ahow Ado Awe Aturn Aan Aapplication Ainto Aan Aimage Awhich Acan Abe Aopened Aas Aa Acontainer Aso Athat Awe Acan Ashare Aour Aapps Awith Aother ADocker Ausers. AWe’ll Atake Aa Alook Aat Ahow Awe Adeploy Athese Aapplications Aand Ahow Awe Acan Ashare Athem Awith Athe Awider ADocker Auser Abase. Chapter AFour Alooks Aat Anetworking Awith ADocker. AThis Acovers Ahow Ayou Acan Aconnect ADocker Acontainers Atogether Aor Aeven Ato Anon-Docker Aworkloads Ain Aorder Ato Areally Amake Ause Aof Athe Afull Apower Aof Athe ADocker Aservice. By Athe Aend Aof Athe Abook, Ayou’ll Abe Aable Ato Aturn Ayour Aapplications Ainto Acontainers, Ashare Aor Arun Athem Athrough ADocker Aand Aconnect Athem Ato Aother Acontainers Aand Asee Ajust Ahow Apowerful ADocker Areally Ais. AThis
Ais Aonly Aa Abeginner’s Aguide, Aso Athe Amore Aadvanced Atopics Aaren’t Agoing Ato Abe Acovered Ahere Abut Aeverything Ayou Aneed Ato Aknow Ato Aget Astarted Awith ADocker Atoday Ais Ain Ayour Ahands Aright Anow.
CHAPTER ONE: UNDERSTANDING DOCKER, CONTAINERS, IMAGES AND DOCKERFILES Docker Acan Abe Aa Abit Aof Aa Aconfusing Aprogram Ato Aunderstand Aif Ayou’ve Anever Aworked Awith Avirtualization Abefore. AIn Aorder Ato Aclear Aup Aany Aconfusion Aaround ADocker, Alet Aus Atake Aa Alook Aat Awhat Ait Ais Aand Awhy Ait Aexists. AThis Awill Ahelp Ayou Ato Adecide Aif ADocker Ais Aright Afor Ayou Aor Anot. AFrom Athere Awe’ll Alook Aat Athe Avarious Acomponents Aof ADocker Ato Aunderstand Awhat Athey Aare Aso Athat Awhen Awe Astart Ausing Athem Ain Athe Afollowing Achapters Athere Awill Abe Ano Aconfusion Asurrounding Awhat Aeach Acomponent Adoes. What Ais ADocker? Docker Afirst Alaunched Aback Ain A2013 Aafter Aseveral Ayears Aof Adevelopment. AAt Aits Acore, ADocker Ais Aa Atool Adesigned Ato Amake Ait Aeasier Ato Arun Aapplications Athroughout Athe ADevOps Aprocess. ADocker Ais Alike Aa Avirtual Amachine Ain Athat Ait Aruns Aon Aa Acomputer Abut Aacts Alike Ait Ais Aits Aown Acomputer. AThis Aallows Afor Ausers Ato Acreate, Adeploy Aand Arun Aapplications Athrough Athe Ause Aof Acontainers, Athe Amain Abuilding Ablock Aof ADocker. AEvery Apiece Aof Aan Aapplication Athat Ais Aneeded Ato Arun Ais Aincluded Awithin Aa Acontainer, Asuch Aas Alibraries Aand Avarious
Adependencies, Aand Athis Aallows ADocker Ato Arun Athose Acontainers Aas Aif Athey Awere Atheir Aown Asystem. AWhat’s Amore, Athis Aallows Afor ADocker Acontainers Ato Abe Ashipped Aout Ato Aother Ausers Awith Aeverything Athey Aneed Ato Arun Athe Acontainer Aincluded. Docker Ais Aan Aopen Asource Aplatform, Atoo. AThis Ameans Athat Aanyone Awho Awants Ato Acan Acontribute Ato ADocker Aand Ause Ait Ato Afit Atheir Aown Aneeds. AIf Athey Afind Athat ADocker Adoesn’t Ahave Aa Afeature Awhich Athey Arequire, Athey Acan Aopen Aup Athe Aprogram Aand Aadd Athe Afeatures Athey Awant Awithout Ahaving Ato Aworry Aabout Abreaking Aany Alaws. Docker Aenables Ausers Ato Aseparate Atheir Aapplications Afrom Athe Ahardware Aand Ainfrastructure Athey Ahave Ain Aplace Ato Aspeed Aup Adelivery. AInfrastructure Acan Abe Amanaged Ain Athe Asame Away Athat Aapplications Aare. ATogether Awith Athe Aflexibility Aof Athe Aopen Asource Anature, Athis Amakes ADocker Aa Apowerful Atool Ain Aspeeding Aup Athe Ashipping, Atesting Aand Adeployment Aof Acode Ato Areduce Atime Abetween Acreating Ait Aand Atesting Ait. In Aaction, Awhat Athis Alooks Alike Ais Aas Afollows. AThe Auser Auses ADocker Ato Adownload Aor Aopen Aup Aan Aimage Afile. AThis Afile Ais Athen Adeployed Aas Aa Acontainer. AThat Acontainer Aitself Ais Aa Aself-contained Aapplication. AInstead Aof Arunning Aa Avirtual Amachine Ain Aorder Ato Athen Arun Athe Aapplication, Athe Aapplication Aitself Ais Arun Alike Aa Avirtual Amachine Aand Athe Auser Acan Asee Aif Ait Aworks Aor Anot Aby Awhether Aor Anot Ait Ais Aworking. AThis Asounds Aredundant Abut Ait Ais Aan Aimportant Anote. AIf Arun Ain
Aa Avirtual Amachine, Athe Aapplication Anot Aworking Amay Abe Atied Ato Athe Avirtual Amachine Aor Athe Aunderlying Ahardware Aand Aso Athere Aare Amany Areasons Ait Amay Anot Awork. AIn ADocker, Ait Adoesn’t Awork Aif Athere Ais Aan Aissue Awith Athe Aapplication Aitself. With Athe AWhat Aof ADocker Aout Aof Athe Away, Alet’s Aturn Anow Ato Athe AWhy: AWhy Ais ADocker Againing Asuch Aattention Ain ADevOps Aand Athe Aproblems Ait Asolves. What AProblems ADoes ADocker ASolve A(And AWhen Ais ADocker ANot ARecommended)? There Aare Aseveral Akey Abenefits Ato Ausing ADocker Ain Ayour ADevOps Aworkflow. AThese Abenefits Amake Ausing ADocker Aa Agreat Afit Afor Amany Aof Ayour Aneeds. ADocker, Ahowever, Aisn’t Asome Amagical Aprogram Athat Awill Afit Aevery Aneed Ayou Amay Ahave. AIn Alooking Aat Athe Abenefits Aof ADocker, Ait Ais Aimportant Ato Aalso Alook Aat Athe Atimes Athat ADocker Awon’t Acut Ait. AThis Away, Ayou Aknow Afor Asure Awhether ADocker Ais Aright Afor Ayou. ABut Afirst, Alet’s Alook Aat Athose Abenefits. One Aof Athe Abiggest Abenefits Ato Ausing ADocker Ais Aits Aisolation. ADocker Acontainers Ainclude Aall Athe Asettings Aand Adependencies Anecessary Ato Arun Athem. AThis Ameans Athat Athe Adependencies Aof Athe Acontainer Awill Anot Aaffect Aany Aof Athe Aconfigurations Aof Athe Acomputer Athey Aare Abeing Adeployed Aon. ANor Awill Athe Acontainers Amess Awith Aany Aother Acontainers Athat Amay Abe Arunning Aat Athe Asame Atime. AWhen Ayou Arun Aa Aseparate
Acontainer Afor Aeach Apart Aof Aan Aapplication A(such Aas Aa Aweb Aserver, Afront Aend Aand Adatabase Athat Ais Aused Afor Ahosting Aa Aweb Asite), Ayou Aare Aable Ato Aensure Athat Anone Aof Athe Adependencies Aconflict Awith Aeach Aother. AContainers Acould Abe Adesigned Ato Ause Aentirely Adifferent Aunderlying Ahardware Afrom Aeach Aother Abut Arun Aat Athe Asame Atime Aperfectly Asmooth Athrough ADocker’s Avirtualization. AThis Amakes Ait Amuch Aeasier Ato Aensure Aeverything Ais Arunning Aproperly Aand Amakes Asharing Aand Adeploying Aapplications Avia Acontainer Amuch Asimpler Afor Aeveryone Ainvolved. With Athis Aalso Acomes Aa Acomponent Aof Areproducibility. AA ADocker Acontainer Ais Aguaranteed Ato Arun Athe Asame Aon Aany Asystem Athat Ais Arunning ADocker. AThe Asystem Aspecifications Aof Aa Acontainer Aare Astored Aon Awhat Ais Acalled Aa ADockerfile. ASharing Athe ADockerfile Awith Ayour Afellow Ateam Amembers Aallows Ayou Ato Aensure Athat Aall Aimages Athey Abuild Amake Ause Aof Athat ADockerfile Aso Athat Aall Athe Acontainers Acan Arun Athe Asame. AThis Acuts Aout Athe Aguesswork Aof Ahaving Ato Aproblem-solve Aissues Arelating Ato Ahardware. The Acontainerization Aof Athe Avarious Acomponents Aof Aan Aapplication Acan Aoffer Aa Alevel Aof Asecurity. AWhen Aan Aapplication Ais Arun Ain Aa Atraditional Afashion, Athere Ais Athe Arisk Athat Aan Aissue Awith Aone Acomponent Acan Acause Athe Arest Aof Athe Acomponents Ato Afail. AWhen Aan Aapplication Ais Arun Athrough ADocker Acontainers, Aa Afailure Ain Aone Apart Acan Aleave Athe Aother Acontainers Aunaffected. AThis Acan Amake Atrouble Asolving Amuch Aeasier. AOther Asecurity Aissues Amay Aarise, Ahowever, Adue Ato ADocker’s
Acontainerization. AIf Asecurity Ais Aimportant Afor Ayour Alarge Aapplications, Aa Amore Adetailed Alook Aat Ayour Aspecific Aneeds Ashould Abe Ataken Abefore Ausing ADocker. Another Abenefit Aof ADocker Ais Athe ADocker AHub. ADocker AHub Ais Aa Adirectory Aof ADocker Aimages Awhich Ahave Abeen Aput Aonline Aand Ashared Ato Abe Aused Aby Aany ADocker Auser Awho Awishes Ato. AThere Aare Amany Aimages Aand Aapplications Athat Acan Abe Afound Aon ADocker AHub. AAll Ayou Aneed Ato Ado Ato Ause Athem Ais Adownload Athe Apre-made Aimages Aand Aput Ait Ainto Aplace. AThis Acan Amake Ayour Avarious ADocker Asetups Aquick Aand Aeasy. AWe’ll Asee Ahow Ato Adownload Aand Atest ADocker Ausing ADocker AHub Ain AChapter ATwo Aand Awe’ll Alearn Ahow Ato Aupload Aimages Ato ADocker AHub Ain AChapter AThree. Since ADocker Acontainers Adon’t Aneed Ato Arun Aan Aentire Avirtual Aoperating Asystem, Ait Ais Amuch Aquicker Aand Amore Aeffective Ato Arun ADocker Acontainers. AA Avirtual Asystem Aneeds Ato Arun Aits Aown Aoperating Asystem Aand Athis Acan Areally Atax Athe Ahardware Abeing Aused. ASince Aeverything ADocker Aneeds Ato Arun Ais Aincluded Ain Athe Acontainer, Athe Avirtualized Asystem Atakes Ahardly Aany Aadditional Aresources Aat Aall. AOne Aof Athe Agreat Athings Aabout Athis Ais Ahow Amuch Aquicker Ait Amakes ADocker Awhen Acompared Ato Aa Avirtual Asystem. AWhat Awould Atake Afive Aminutes Ato Aboot Aon Aa Avirtual Asystem Atakes Acloser Ato Afive Aseconds Awhen Aused Athrough ADocker.
Because Aof Aall Athese Abenefits, ADocker Ais Aparticularly Agreat Afor Ause Ain Athe Afollowing Amanners. When Ayou Aare Alearning Aa Atechnology, Ayou Acan Ause ADocker Ain Aorder Ato Askip Aspending Aany Atime Aon Ainstallation Aand Aconfiguration. ASince Aeverything Ayou Aneed Ato Arun Athe Aprogram Ais Aincluded Ain Athe ADocker Acontainer, Ayou Acan Alaunch Athe Acontainer Ato Aget Ayour Ahands Aon Anew Aapplications Aquickly Ato Asee Aif Athey Ainterest Ayou Aor Aare Arelevant Ato Asolving Athe Avarious Aissues Ayou Aare Alooking Ato Atackle. Docker Ais Aalso Afantastic Afor Asimple Auses Asuch Aas Asetting Aup Aand Arunning Aa AMinecraft Aserver. AMany Asimply Aapplications Asuch Aas Athis Aalready Ahave Asupported Aimages Aavailable Aon ADocker AHub Aand Ayou Acan Aquickly Agrab Athem, Adeploy Athem Aand Awalk Aaway. AThis Acan Areduce Athe Atime Anecessary Afor Asetting Aup Abasic Aapplications Aand Aget Ayou Aup Aand Arunning Ain Aa Amatter Aof Aseconds. As Amentioned Aabove, Aisolation Ais Aa Abig Afeature Aof ADocker Aand Athis Ais Afantastic Afor Arunning Amultiple Aapplications Aon Aa Aserver. AYou Acan Areduce Athe Aamount Aof Aissues Ayou Ahave Awith Aa Asingle Aserver Aby Akeeping Athe Avarious Aapplications Acompartmentalized Athrough ADocker Acontainers. AThis Aallows Ayou Ato Aprevent Aany Apossible Aproblems Awith Adependency Amanagement Athat Ayou Amay Ahave Ato Adeal Awith Aotherwise. ATeams Acan Alose Ahours Aor Aeven Adays Atrying Ato Atroubleshoot Adependency Aissues Awhich Acould Ahave Abeen Aavoided Aentirely Athrough Athe Aimplementation Aof ADocker.
By Afar, Athe Abest Ause Aof ADocker Ais Afor Adevelopment Ateams. AOn Aany Agiven Adeveloper Ateam, Athere Ais Asure Ato Abe Aa Amultitude Aof Adifferent Asetups Ain Aterms Aof Ahardware Aand Aunderlying Ainfrastructure. ASince Athe Ause Aof Aa ADockerfile Aallows Acontainers Ato Abe Acreated Awith Aa Auniform Ainfrastructure Ain Aplace, Ausing ADocker Aremoves Athe Avariability Abetween Adeveloper Asystems Aand Aallows Afor Athe Aexchange Aof Aapplications Aand Athe Atesting Aof Athose Aapplications Ato Abe Astreamlined. ACutting Aout Athe Avariability Aand Adecreasing Athe Atime Abetween Abuilding Aand Atesting Amakes ADocker Aabsolutely Aamazing Afor ADevOps. At Athe Asame Atime Athat ADocker Amakes ADevOps Asmoother, Athere Aare, Aof Acourse, Aareas Ain Awhich Ait Aisn’t Athe Amost Aeffective Atool Ato Ause. AWhen Ait Acomes Ato Athe Afollowing Asituations, Ayou Aare Abetter Aoff Alooking Afor Aalternatives Ato ADocker. If Ayour Aapplication Ais Atoo Acomplicated, Athen Aa Apre-made ADockerfile Aor Aa Apreviously Acreated Aimage Alikely Awon’t Acut Ait. AIf Ayou Afind Athat Ayou Aare Agoing Ato Aneed Ato Abuild, Aedit Aand Ahandle Acommunication Abetween Aseveral Acontainers Aspread Aacross Aseveral Aservers Athen Athe Aamount Aof Atime Anecessary Ato Aget Aset Aup Ais Agoing Ato Abe Arather Ahigh Aand Ayou Awill Abe Abetter Aoff Alooking Afor Aanother Asolution Aoutside Aof ADocker. You Amay Aalso Afind ADocker Ato Abe Ainsufficient Afor Ayour Aneeds Aif Aperformance Ais Aof Acritical Aimportance Afor Ayour Aapplication. ADocker Ais Afar Afaster Awhen Acompared Ato Avirtual Amachines Abut Ait Astill Aadds Aanother
Acost Aonto Athe Aperformance Aof Athe Asystem Ait Ais Arunning Aon. ARunning Aa Aprocess Ainside Aof Aa Acontainer Awon’t Abe Aas Aquick Aas Awhen Ayou Arun Athat Aapplication Aon Athe Asystem’s Anative Aoperating Asystem. AIf Aevery Asecond Amatters Afor Ayour Aapplication Athen ADocker Ais Aonly Agoing Ato Abe Aa Ahindrance. Docker Ais Aalso Astill Aa Anew Apiece Aof Atechnology Aand Aas Asuch Ait Ais Astill Aunder Adevelopment. AAs Anew Afeatures Aare Aadded Ato ADocker, Ayou Awill Aneed Ato Aupgrade Ait Ain Aorder Ato Aaccess Athem. ABackwards Acompatibility Abetween Areleases Aof ADocker Aisn’t Aguaranteed, Athough. AThis Ameans Athat Ayou Amay Afind Ayourself Aupgrading Aoften Aand Arisking Ayour Aentire Asetup Aevery Atime Athat Ayou Ado Aso. AThis Alevel Aof Auncertainty Acan Abe Astressful Ato Asome, Aso Aconsider Ait Afor Ayourself Abefore Aadopting ADocker. Another Adownside Ais Athe Away Athat ADocker Amakes Ause Aof Athe Anative AOS Aon Athe Asystem Ait Ais Arunning. AWe’ll Abe Alooking Aat Athis Ain-depth Ain AChapter ATwo, Abut Awhat Ait Ameans Ahere Ais Athat Aif Ayour ADevOps Ateam Ais Ausing Amultiple Aoperating Asystems, Athen ADocker Awon’t Afit Ayour Aneeds. AIn Athis Aparticular Acase Ayou Aare Abetter Aoff Ausing Avirtual Amachines. Because ADocker Awas Adesigned Awith Aapplications Athat Arun Aon Athe Acommand Aline Ain Amind, ADocker Ais Anot Awell Asuited Afor Aapplications Awhich Arequire Aa Agraphical Ainterface. AThere Aare Aways Ain Awhich Ayou Acan Arun Aa Agraphical Ainterface Ainside Aa ADocker Acontainer, Alike Amaking Ause Aof AX11 Aforwarding, Abut Aeven Athen Athese Afunction Apoorly. AIf Ayour
Aapplication Ais Aof Aa Avisual Anature, Ayou Aare Abetter Ausing Athe Anative AOS Aor Aa Avirtual Amachine. Docker Aalso Ahas Asecurity Aissues Awhich Ayou Ashould Abe Aaware Aof. ASince Athe Akernel Aof Athe AOS Ais Ashared Abetween Athe Avarious Acontainers Ain Ause, Aany Avulnerability Aof Athat Akernel Ais Aalso Apresent Ain Ayour Aactive Acontainers. AIf Ayou Ahave Aa Acontainer Athat Aallows Aaccess Ato Aresources Alike Amemory Athen Adenial-of-service Aattacks Acould Abe Aused Ato Astarve Athe Aother Acontainers Aactive Aon Athe Ahost Asystem. ASomeone Athat Abreaks Ainto Aa Acontainer Acould Apossibly Abreak Aout Aof Athe Acontainer Aand Acarry Aover Athe Aprivileges Afrom Athat Acontainer Ato Athe Ahost Asystem. ADocker Aimages Acould Aalso Abe Apoisoned Aand Atampered Awith Ato Amake Ait Aeasier Afor Aan Aattacker Ato Again Aaccess Ato Ayour Asystem Aif Ayou Aaren’t Acareful. AThis Ais Aespecially Abad Aif Ayou Ause Acontainers Aas Adatabases Afor Aany Atype Aof Asecure Ainformation Alike Ausernames Aand Apasswords. AAll Aof Athese Asecurity Aissues Aare Apresent Aand Aimportant Ato Abe Aaware Aof Abefore Ayou Astart Ausing ADocker. As ADocker Acontinues Ato Agrow, Amany Aof Athese Aissues Aare Asure Ato Abe Aaddressed Aand Afixed. AThe Arate Aat Awhich ADocker Ais Abeing Aadopted Athroughout Athe Atech Aworld Aalmost Aguarantees Athat ADocker Ais Aonly Agoing Ato Abecome Amore Asecure Aand Amore Acomprehensive Ain Athe Ayears Ato Acome. What AAre AContainers?
A Acontainer Ais Aa Aunit Aof Asoftware Athat Ahas Abeen Astandardized. AThe Astandardization Asees Athe Asoftware Apackaged Aalong Awith Aall Aof Athe Anecessary Acode Aand Adependencies Arequired Ain Aorder Ato Arun Athe Aapplication Aon Aany Agiven Acomputing Aenvironment. AContainers Ahave Aexisted Asince Along Abefore ADocker Abut ADocker Ahas Apopularized Atheir Ause Aby Asimplifying Athe Aprocess Aof Aaccessing Aand Amaking Ause Aof Athem. ADocker Acontainers Aare Alightweight Aand Acapable Aof Astanding Aalone. AEverything Athat Ais Aneeded Ato Arun Athe Aapplication Ais Ain Athe Acontainer Aexcept Afor Athe ADocker Aprogram Awhich Acan Abe Adownloaded Afreely Aand Ainstalled Aon Aany Acomputer Ain Aa Amatter Aof Aminutes. ADocker Acontainers Abegin Aas Aimages, Awhich Awe’ll Alook Aat Ain Aa Amoment. AIt Ais Aonly Aonce Athe Aimage Ais Arun Athat Ait Abecomes Aa Acontainer Aitself. A Ametaphor Afor Acontainers Athat Ahas Abeen Aused Aoften Ais Athat Aof Aa Ashipping Acontainer Aon Aa Aboat. APretend Ayou Aare Ashipping Aa Abunch Aof Aoffice Achairs. AYou Acould Astack Athese Achairs Aon Athe Aboat Aby Athemselves Abut Athey Arisk Abeing Athrown Aaround Aby Awaves Aand Aother Aenvironmental Afactors. AThis Ais Awhat Ais Ait Alike Awhen Ayou Arun Aapplications Aon Ayour Anative Asystem Aand Ajuggle Aconflicting Adependencies Aand Athe Alike. AThe Afar Aeasier Away Ato Aship Athose Achairs Awould Abe Ato Aput Athem Ainto Aa Ashipping Acontainer. ANow Athe Acontainer Ais Asolid Aand Alocked Ain Aplace Aso Athose Achairs Adon’t Ago Aanywhere Awhen Awaves Atoss Athe Aship Aaround. AIf Aone Ashipping Acontainer Afalls Aoff Athe Aship, Athe Aothers Aare Astill Asecure Ain Atheir Aplace. AThis Ais Awhat Ausing Acontainers Afor Aapplications Ais Alike:
Athe Acontainers Asecure Aeverything Awithin Athemselves Ato Amake Ait Aeasier Afor Athe Acomputer A(the Aship). As Amentioned Apreviously, Acontainers Aand Avirtual Amachines Amay Aseem Aquite Asimilar Ato Aeach Aother Ain Athat Athey Aboth Aisolate Aresources Aand Ahave Asimilar Aallocation Aof Asaid Aresources. AContainers Adon’t Avirtualize Athe Ahardware Athe Asame Away Athat Avirtual Amachines Ado, Athough. AA Avirtual Amachine Ais Aan Aabstraction Aof Athe Aphysical Ahardware. AYou Ahave Ayour Aunderlying Ainfrastructure, Athen Athe Avirtual Amachine Amonitor Aon Atop Aof Awhich Asits Athe Aguest Aoperating Asystem Ain Awhich Ayour Aapp Awill Arun. AA Acontainer, Aon Athe Aother Ahand, Ais Aan Aabstraction Aat Athe Alayer Aof Athe Aapp. AYou Ahave Ayour Ainfrastructure, Afollowed Aby Athe Ahost Aoperating Asystem Aon Awhich ADocker Aruns Aand Aeach Acontainer Athen Aruns Athrough Athat. AThis Aallows Afor Amore Aapplications Ato Abe Ahandled Aby Athe Asystem, Aquicker. AIt Ais Aimportant Ato Anote Athat ADocker Acontainers Acan Abe Aused Atogether Awith Aa Avirtual Amachine Aif Aone Aso Achooses Aand Aso, Awhile Athey Amake Afor Aan Aapt Acomparison, Athey Ado Anot Aneed Ato Abe Athought Aof Aas Areplacements Afor Aeach Aother Ain Athe Astrictest Asense. What AAre ADocker AImages? A ADocker Aimage Ais Aa Akind Aof Afile Awhich Ais Aused Ain Aorder Ato Arun Acode Ain Aa ADocker Acontainer. AMade Aup Aof Aseveral Alayers, Aan Aimage Ais Abuilt Afrom Athe Ainstructions Afor Aa Aworking Aversion Aof Aan Aapplication.
AWhen ADocker Aruns Aan Aimage Afile, Ait Aturns Athat Aimage Ainto Aa Acontainer. AIn Athe Ametaphor Aof Athe Aship Awe Adiscussed Aabove, Athe ADocker Aimage Awould Abe Athe Alayout Aplan Afor Ahow Aeach Ashipping Acontainer Awould Abe Alaid Aout. AWithout Athe Aimage, Athere Acan Abe Ano Acontainer Abecause Athere Awould Abe Anothing Ato Amake Aup Athe Ainside Aof Athat Acontainer. AAnother Away Ato Athink Aof ADocker Aimages Ais Ato Aconsider Athem Ato Abe Aa Asnapshot Aof Athe Aapplication Ain Aquestion. AThey Aare Aan A“image” Aof Athe Aapplication Arunning Acomplete Awith Aeverything Ait Arequires Ato Arun Aand Aso, Awhen Athat Aimage Ais Athen Aturned Ainto Aa Acontainer, Ait Ahas Aall Aof Athese Aelements Apresent. Each ADocker Aimage Ais Amade Aup Ato Ainclude Athe Asystem Alibraries, Atools Aand Adependencies Anecessary Afor Athe Aexecutable Acode Aof Athe Aapplication Ait Arepresents. ABecause Aan Aimage Ais Amade Aup Aof Amultiple Alayers, Adevelopers Aare Aable Ato Areuse Aimage Alayers Afor Adifferent Aprojects Awhere Aapplicable. AThe Are-use Aof Alayers Afrom Aimages Aallows Adevelopers Ato Asave Atime Asince Athey Adon’t Aneed Ato Amake Aevery Alayer Aof Athe Aimage Athemselves. AImages Atend Ato Astart Awith Aa Abase Aimage, Athough Athey Acan Abe Amade Afrom Ascratch Aif Anecessary. AThe Astatic Alayers Aof Athe Aimage Arest Aunderneath Aa Areadable/writable Atop Alayer. ALayers Aget Aadded Ato Athe Abase Aimage Ain Aorder Ato Afinetune Ahow Athe Acode Awill Arun Ain Athe Acontainer Athat Aopens. AEach Alayer Aof Athe Aimage Acan Abe Aviewed Ain ADocker Ausing Asimple Acommands A(which Awe Awill Abe Alearning Ashortly).
Comments 0
Loading comments...
Reply to Comment
Edit Comment