Docker: zvese nezve midziyo

 

Docker Logo: Mudziyo Wakatakurwa Whale

Sezvaunenge uchitoziva, kune akati wandei marudzi ehunyanzvi, imwe yacho ndeyekuona padanho rekushandisa, uye rimwe remapurojekiti anomira zvakanyanya mune izvi Docker, pamwe nemamwe akavhurika-sosi mapurojekiti senge OpenVZ, LXC / LXD, Linux-VServer, nezvimwe, kana proprietary Virtuozzo software. Kana iwe uchiziva ino nyika kana kana iwe uri wenguva dzose pamhando iyi yeblog, iwe unenge uchitoziva nezve iyo purojekiti ine logo iri whale (nekudaro zita revaya vachiri kusazviziva), uye pamusoro pezvose uchave waona sei mumakore achangopfuura kuvepo kwayo mune vezvenhau uye kufarira kuri kuwedzera zvakanyanya.

Uye ndezvekuti aya matekinoroji matsva aripo uye neramangwana, kunyanya nekukura kwechisimba kwemasevhisi mu gore yatakataura kakawanda kudaro. Docker, pakati pemamwe akawanda akavhurwa sosi uye mapurojekiti emahara, ndiwo ari kubvumira uku kuwedzera uye mikana mikuru yatinoda kubva mugore. Asi chii chinonzi Docker? Chii chinonzi container? Chinoshanda sei?

Docker nemidziyo:

RancherOS

Kunyange zvakadaro mhinduro yacho yakati omei uye ini ndaizoda dzinoverengeka zvezvinyorwa izvi, ndichaedza kuzvipfupisa. Nekudaro, kana iwe uchida kuziva zvakawanda nezve ino naka projekiti, kune mabhuku akanaka kwazvo saAlberto González, aripo Red Hat Cloud Consultant. Iri igwara rinoshanda iwe raunogona kuwana pamutengo unodhura zvese mukati Amazon sezvazviri Agapea. Zvakanaka, nezvakataurwa, ngatizivei kuti Docker chii.

Isu tose tinozviziva Midziyo Vakave chishandiso chine zvakawanda zvinogona muLinux, zvakanaka, vanogona kuitiswa uye kutarisirwa nekuda kweDocker software. Midziyo hapana chimwe kunze kwekusarudzika "mabhokisi" ane zvakakosha kuti ukwanise kumhanyisa imwe chirongwa kana kunyorera. Izvi zvinogona kunzwisiswa seyakareruka muchina muchina, panzvimbo yeakazara uye anorema ayo anoshanda nawo mukuzara kuona. Uku kudzikisira kunoshandura kuenda kumusoro kwepamusoro.

Midziyo inowedzera kureruka, futi kutakurika, kuzvigutsa, uye kushanduka inochiva zvikuru nevagadziri. Zvese zvekutenda kuLXC kubva kune yedu inodiwa kernel, Linux, uye kune iyo Docker chirongwa chairo, iine midziyo yayo, mifananidzo uye zvinyorwa. Uye izvi zvakanaka izvi zvaunza budiriro, izvo zvakacherechedzwa nekubatanidzwa kwemamwe makambani makuru mubazi senge Google, Red Hat, IBM neMicrosoft, pamwe nekumisikidza kwayo uye kugamuchirwa kwakanaka mumakambani makuru uye gore masevhisi ayo ese atinoishandisa mazuva ese (AWS, Dhijitari Ocean,…).

Isa Docker nhanho nhanho:

Docker Cloud webhu interface

Une dzimwe nzira dzinoverengeka kuisa Docker, kubva mukuwana iyo tarball nekodhi kodhi uye kuumbiridza, kutora mabhinari kubva kune akasiyana marekodhi uye kuatonga iwo nemapakeji maneja eakavhurikaSUSE distro, Ubuntu, Debian, CentOS, Fedora, nezvimwe. Pamwe nemapakeji emabhinari anonyanya kusununguka, asi kuti urege kurebesa musoro wenyaya zvakanyanya, ndiri kuzopa nzira yakatwasuka uye yepasirese inoshanda chero mukuparadzira:

sudo curl -fsSL https://get.docker.com/ | sh

Zvakareruka sekudaro. Zvino tava nazvo dhiabhori nemutengi, yekupedzisira ichave iyo inobatana neDocker daemon uye ichatibvumidza isu kuti tiite zvese zvinopihwa neiyi software. Asi pachine chimwe chinhu chekuita, uye ndiko kusimudza sevhisi, ndokuti, tanga iyo Docker daemon. Zve systemd unogona kuita zvinotevera:

sudo systemctl enable docker

sudo systemctl start docker

Kana zvese zvikafamba mushe, ichave yatove kushanda zvese. Unogona kuzvitarisa ne:

sudo systemctl status docker

Tinogona kutanga kuishandisa izvozvi ...

Matanho ekutanga: kugadzira mudziyo

Dhayagiramu yemudziyo

Zvakanaka, sezvaunotoziva kare, mudziyo Iyo pasuru ine zvese zvinodiwa kuti imwe kana akawanda mashandiro amhanye, ndiko kuti, akafanana nemuchina chaiwo, asi wakareruka nekuenderana neiye Anogashira kuurayiwa. Kuti mudziyo ushande, unofanirwa kuve nemaraibhurari anodikanwa ekumisikidza, pamwe nekumwe kutsamira, senge mamwe maturu ekushandisa. Ehezve, chimwe chezvikamu zvinodiwa inguva yekumhanya, ndiko kuti, nharaunda yekuuraya senge vaturikiri yemitauro yakadudzirwa, JVM, mafaera ane kodhi kana mabhinari, nezvimwe.

Pane zvimwe yekutanga mirairo yeDocker iyo iwe yaunofambisa "mukati" mukati mezvakatipoteredza, iwo akawandisa, senge info, kuisa, kuuraya, kumira, kutanga, kuvaka, ps, nezvimwe. Kuti uone iwo ese uye izvo zvega zveumwe neumwe, zvese zvaunofanirwa kuita kumhanya:

docker

Kuti uwane rumwe ruzivo iwe unogona kubvunza zvinyorwa zviri pamutemo.

ungadaro sei? gadzira mudziyo neDocker? Zvakanaka, ikozvino tichaenda kupa muenzaniso, isu tichagadzira mudziyo neUbuntu uye kune izvi isu tinoshandisa iyo yekuraira kuraira, iyo inobvumidza zvese zviri zviviri kugadzira nekuita midziyo (rumwe ruzivo mhanya -h):

docker run -i -t ubuntu /bin/echo Prueba contenedor

Uye izvo zvinoshandisa chifananidzo chemuno kana isu tatova nacho kana, kana chikasakwanisa kuiwana, ichaitora. Chii chimwe ichagadzira mudziyo, Ichagovera nzvimbo yeiyo FS nyowani nekuisimudza. Ehezve iwe unogovera network network yevaenzi / yekutaurirana yekugamuchira. Paunenge wapedza, zvinotitaridza maungira pamwe nemutsara «Mudziyo bvunzo»Izvo takaisa.

Unogona ona mifananidzo yese une chii ne:

docker images

Uye nokuda kubvarura imwe, unogona kushandisa ID yemidziyo ne:

docker start -a <pon-la-ID-del-container>

Kuvamisa, unogona kushandisa stop pane kutanga:

docker stop <pon-la-ID-del-container>

Uye izvi ndizvo chete zvekutanga muDocker. Ndinovimba yakubatsira kuti utange uye utore nhanho dzekutanga dzevakawanda, nekuti inogona kukupa mikana yakawanda. Sezvauri kuona, iwo musoro wakapamhama uye mauri unogona kudzamisa uchitanga nedzidziso iyi kana kutenga mamwe mabhuku akadai seakataurwa mundima dzekutanga, izvo zvandinokurudzira kuti zvive nyore mukutsanangurwa kunoshanda. Usakanganwa kusiya zvaunotaura...


Izvo zviri muchinyorwa zvinoomerera pamisimboti yedu ye tsika dzekunyora. Kuti utaure chikanganiso tinya pano.

Mhinduro, siya zvako

Siya yako yekutaura

Your kero e havazobvumirwi ichibudiswa. Raida minda anozivikanwa ne *

*

*

  1. Inotarisira data: AB Internet Networks 2008 SL
  2. Chinangwa cheiyo data: Kudzora SPAM, manejimendi manejimendi.
  3. Legitimation: Kubvuma kwako
  4. Kutaurirana kwedata
  5. Dhata yekuchengetedza: Dhatabhesi inobatwa neOccentus Networks (EU)
  6. Kodzero: Panguva ipi neipi iwe unogona kudzora, kupora uye kudzima ruzivo rwako

  1.   agoramic akadaro

    Zvinonakidza, ini ndichatarisira kune zvinotevera zvinyorwa, ndatenda