Uyifaka njani kwaye uyisebenzise i-Docker kunye nezikhongozelo zayo ku-Ubuntu

I-Docker kwi-Ubuntu

Docker yiprojekhthi yemithombo evulekileyo exhaswa liziko leshishini elinegama elifanayo elenza kube lula ukuqhuba inkqubo yokwenza isicelo kwindawo ekwanti ekude ebizwa ngokuba isitya okanye isikhongozeli. Ngokungafaniyo nomatshini obonakalayo (i-VM) ene-kernel yayo, isikhongozeli sixhomekeke kwikernel yenkqubo yokubamba, siyivumele ikhaphukhaphu kwaye ibaleke ngokukhawuleza okukhulu.

I-Docker sesona sixhobo silula sinikwa yikhompyuter yethu Uphuhliso lwesicelo seshishini kunye namandla okuphatha. Ngokuzenzekelayo, izikhongozeli zeDocker zibaleka zisebenzisa imifanekiso yesicelo ebanjwe kwiDocker Hub, apho sinokufikelela khona esi sixhobo. Kule nqaku siza kukubonisa ukuba ungazifaka njani kwaye uzisebenzise njani ezi zikhongozeli ku-Ubuntu kunye nolunye unikezelo olusekwe kwinkqubo yokusebenza ephuhliswe yiCanonical.

Ukufaka i-Docker kwi-Ubuntu

Eyona nto intle ukuba injongo yethu kukusoloko sinoguqulelo lwamvanje lwesoftware kukufaka indawo yokugcina esemthethweni yesoftware ekuthethwa ngayo. Ukwenza oku, siya kulandela la manyathelo:

  1. Kuqala sivula i-terminal kwaye singenise isitshixo se-GPG sesoftware ngalo myalelo ulandelayo:
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 \
--recv-keys 58118E89F3A912897C070ADBF76221572C52609D
  1. Emva koko, songeza indawo yokugcina esemthethweni:
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
  1. Sihlaziya iipakeji:
sudo apt-add-repository 'deb https://apt.dockerproject.org/repo ubuntu-xenial main'
  1. Emva koko, siya kufaka i-Docker ngalo myalelo ulandelayo:
sudo apt install docker-engine

 Uqhuba njani izikhongozeli zeDocker

El daemon I-Docker yayisele isebenza. Ngoku, ukusebenzisa isixhobo sethu sokuqala, siya kusebenzisa lo myalelo:

sudo docker run hello-world

Njengoko besitshilo ngaphambilana, izikhongozeli zeDocker zisingathwa ngokungagqibekanga kwindawo yazo. Kukho amakhulu okanye amawaka emifanekiso ekhoyo, ke siya kwenza uphando ukuze siphumeze lowo unomdla kuthi. Umzekelo, umyalelo wokukhangela ukufumana umfanekiso malunga neLinux Mint, enye yezona zinto zithandwa kakhulu kwi-Ubuntu, iya kuba yile ilandelayo:

sudo docker search "linux mint"

Ukukhangela kwangaphambili kuya kusibonisa into elandelayo:

docker-imifanekiso

Xa sifuna umfanekiso wokuqhuba isikhongozeli, kufuneka sihlale sisebenzisa ikholamu ethi "Kulungile" okanye "Esemthethweni", oko kuthetha ukuba ivela kwiprojekthi yakho hayi nakubani na. Kuluhlu oludlulileyo akukho namnye osemthethweni, kodwa omnye uvela ku-Ubuntu. Siza kuqhuba isikhongozeli usebenzisa umfanekiso osemthethweni we-Ubuntu (ovela ngaphambili) ngalo myalelo ulandelayo:

sudo docker run -it ubuntu bash

Lo myalelo ungasentla uzakukhuphela umfanekiso we-Ubuntu, usebenze isikhongozeli, ugcine usebenza, kwaye usinike ukufikelela kwi-tty ngaphakathi kuyo kunye ne-Bash. Siza kuqonda ukuba kha wuleza itshintshele kwinto efana nayo ingcambu @ 131a58505d2d: / #, apho emva kwet i-ID eyahlukileyo yesikhongozeli.

Sebenzisa ukufikelela kumgca wokuyalela sinokwenza nantoni na, njengokuphuma kwisitya, ukuhlaziya isiseko sedatha yephakheji, ukuhlaziya inkqubo okanye ukufaka nayiphi na isoftware.

Ukucoca

Xa siqhuba isikhongozeli, umxhasi weDocker kufuneka akhuphele umfanekiso kwiDocker Hub. Le mifanekiso iya kugcinwa kwikhompyuter yethu kwaye iya kuhlala ikho nokuba simile kwaye siyisusile ikhonteyina, ke Zonke ezo ntsalela kufanelekile ukuba zisuswe esingazukuphinda siyisebenzise.

Ukudwelisa imifanekiso ebanjwe kwikhompyuter yethu, siza kubhala lo myalelo ulandelayo:

sudo docker images

Oku kuyakusibonisa yonke imifanekiso ebanjelwe kwikhompyuter yethu. Ukubasusa, siya kubhala umyalelo onje ngale ilandelayo, apho "molo-mhlaba" ingumfanekiso esifuna ukuwucima:

sudo docker rmi hello-world

Sebenzisa isoftware eboniswe kule post kunye nezikhongozeli zayo kunokuba nomdla kakhulu kwabanye abasebenzisi. Ngaba ungomnye wabo?

Ukuhamba | linuxbsdos.com


Shiya uluvo lwakho

Idilesi yakho ye email aziyi kupapashwa. ezidingekayo ziphawulwe *

*

*

  1. Uxanduva lwedatha: UMiguel Ángel Gatón
  2. Injongo yedatha: Ulawulo lwe-SPAM, ulawulo lwezimvo.
  3. Umthetho: Imvume yakho
  4. Unxibelelwano lwedatha: Idatha ayizukuhanjiswa kubantu besithathu ngaphandle koxanduva lomthetho.
  5. Ukugcinwa kweenkcukacha
  6. Amalungelo: Ngalo naliphi na ixesha unganciphisa, uphinde uphinde ucime ulwazi lwakho.

  1.   Beto GomHez sitsho

    Kumntu ofayo onjengam, ndingayifaka njani i-docker kwi-Ubuntu bam?

  2.   I-Technocybers sitsho

    Uncedo kukuba ayizisebenzisi izibonelelo ezibonakalayo kodwa inezinto ezisengqiqweni kuphela.Ungaphakamisa oomatshini abangama-20 kwimizuzu emibini, yintoni enokwenziwa ngabanye ngeyure.