Maitiro ekuisa Docker pane Debian 10

 

Mune ino dzidziso, isu tichadzidza nzira yekuisa uye kushandisa Docker pane Debian 10 VPS.

Docker chishandiso chakasununguka uye chakashama-sosi chishandiso chinoshandisa OS-level virtualization kuendesa software mumapaketi anonzi maidzi. Docker yakanyatsogadzirirwa kuti ive nyore kugadzira, kutumira uye kumhanyisa manyorerwo nekushandisa midziyo. Docker midziyo ndeanehuremu uye yakafanana neVirtual Machine, uchishandisa iyo host OS. Midziyo inobvumidza iwe kurongedza kumusoro kweseji nezviratidzo zvese zvinodiwa maraibhurari uye zvimwe zvinoenderana uye uzvitumire mupakeji imwechete.

Docker anogovera zvakafanana Linux kernel uye zvimwe zviwanikwa sehurongwa hwavari kushanda pairi, uye zvinongoda iyo application pamwe chete nehukoshi hwayo kuti iiswe. Izvi zvinomhanyisa yako kuita system uye kuderedza saizi yekushandisa. Docker ndeye mahara, saka chero munhu anogona kubatsira kuDocker uye iri kuvhurika-sosi inobvumira chero munhu kuti kuiwedzere uye iwane zvavo zvavanoda. Vavariro huru yeiyo Docker ndeyekuvandudza vanogadzira zvishandiso zviri nyore, vanovatumira mumidziyo, uye voiendesa chero kupi.

Zviri Mukati

Zvinodiwa:

  • A VPS inomhanya Debian 10. Nechinangwa chedzidziso iyi, isu tinoshandisa yedu SSD 2 Debian 10 VPS.
  • Zvose SSH midzi yekusvikirwa kana munhu anoshandisa mararamiro echirudo anodiwa zvakare.

Nhanho 1: Pinda mukati kuburikidza neSSH uye Dzokorora Mapakeji

Pinda zvako muDebian 10 VPS yako neSSH senge midzi yemushandisi:

ssh [email protected] IP_Address -p Port_number

Tsiva “mudzi” nemushandisi une mikana yekushambadza kana zvichidikanwa. Pamusoro pezvo, dzora "IP_Address" uye "Port_Number" nekero yako sevhareji IP uye nefoni SSH port. Tevere, ngative nechokwadi chekuti tiri paDhibhari 10. Unogona kuita izvi saizvozvi:

# lsb_release -a

Iwe unofanirwa kuwana izvi sechibodzwa:

Distributor ID: Debian Tsanangudzo: Debian GNU / Linux 10 (buster) Dudziro: 10 Codename: buster

Wadaro, mhanya unotevera kuraira kuti uve nechokwadi chekuti zvese zvakaiswa paseji pane server zvinogadziriswa kumhando dzazvino dzinowanika.

# apt kugadzirisa && apt kusimudzira

Nhanho yechipiri: Isa Docker

Usati watanga, iwe uchafanirwa kuisa kumwe kuenderana kuti ubvumire yako system yekuwana iyo Docker repositories pamusoro peHTTPS. Iwe unogona kuvamisa ivo vese nemirairo inotevera:

sudo apt-tora kuisa apt-kutakura-https ca-zvitupa curl gnupg2 software-zvinhu-zvinozivikanwa

Kamwe zvese zvinodiwa zvinodiwa zvaiswa, dhawunirodha uye wobva wawedzera Docker's GPG kiyi nemirairo inotevera:

curl -fsSL https://download.docker.com/linux/debian/kupg | sudo kukaka-kiyi wedzera -

Tevere, wedzera iyo Docker repository nemirairo inotevera:

sudo wedzera-apt-repository "mad [arch = amd64] https://download.docker.com/linux/debian $ (lsb_release -cs) solid"

Pakupedzisira, gadziridza repository uye isa yazvino vhezheni yeDocker nemirairo inotevera:

sudo apt-tora sudo apt-tora kuisa docker-ce

Kana iko kuiswa kwapera, tarisa chimiro cheDocker nemirairo inotevera:

sudo systemctl chinzvimbo docker ● docker.service - Docker Chishandiso Injini Inotakurwa: yakatakura (/lib/systemd/system/docker.service; inogoneswa; mutengesi preset: inogoneswa) Inoshanda: inoshanda (inomhanya) kubva Wed 2019-09-18 07: 14:31 EDT; 5min apfuura Docs: https://docs.docker.com Main PID: 17988 (dockerd) Tasks: 8 Memory: 91.0M CGroup: /system.slice/docker.service └─17988 / usr / bin / dockerd -H fd: // --containerd = / run / containerd / containerd.sock

Iwe unogona zvakare kutarisa ruzivo nezve Docker nemirairo inotevera:

Sudo docker info

Iwe unofanirwa kuwana zvinhu zvinotevera:

Mutengi: Debug Mode: nhema Server: Midziyo: 0 Kumhanya: 0 Kumiswa: 0 Kumiswa: 0 Mifananidzo: 1 Server Shanduro: 19.03.2 Kuchengetedza Mutyairi: kufukidza2 Kutsigira Filesystem: extfs Inotsigira d_type: ichokwadi Native Kufukidza Kusiyana: kwechokwadi Kutyaira Mutyairi: json -file Cgroup Mutyairi: cgroupfs Mapulagi: Vhoriyamu: yemuno Network: bhiriji inomiririra ipvlan macvlan null yekufukidza Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd vhezheni: 894b81a4b802e4eb2a91d1ce216b8817763c29fb runc vhezheni: 425e105d5a03fabd737a126ad93d62a9eeede87f init version: fec3683 Security Options: apparmor seccomp Profile: default Kernel Version: 4.19.0-5 Linux: Chiyeuchidzo: 64MiB Zita: debian ID: DNIZ: KB10U: H86MN: RURG: G64DW: PGSF: 1TIS: OPCF: RSNQ: RCGR: ZOCC: U987.5MF Docker Root Dir: / var / lib / docker Debug Mode: false Registry: https: //index.docker.io/v6/ Lab els: Kuedza: kwenhema Kusachengeteka Kunyoresa: 3/2 Rarama Dzoreredza Yakagoneswa: nhema

Nhanho 2a: Isa Shanduro Yakajeka yeDocker

Mune zvimwe zviitiko, iwe unofanirwa kuisa shanduro chaiyo yeDocker pane yako system. Mune ino kesi, tanga kunyora shanduro dzinowanikwa dzeDocker nekumhanyisa inotevera mirairo:

sudo apt-cache madison docker-ce

Iwe unofanirwa kuona iyo yese iripo shanduro yeDocker mune inotevera kubudiswa:

docker-ce | 5: 19.03.2 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 19.03.1 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 19.03.0 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.9 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.8 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.7 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.6 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.5 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.4 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.3 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.2 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.1 ​​~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 5: 18.09.0 ~ 3-0 ~ debian-buster | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 18.06.3 ~ ce ~ 3-0 ~ dhongi | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 18.06.2 ~ ce ~ 3-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 18.06.1 ~ ce ~ 3-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 18.06.0 ~ ce ~ 3-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 18.03.1 ~ ce-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 18.03.0 ~ ce-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 17.12.1 ~ ce-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzika amd64 Mapakeji docker-ce | 17.12.0 ~ ce-0 ~ debian | https://download.docker.com/linux/debian buster / yakagadzikana amd64 Mapakeji

Tevere, iwe unogona kuisa yako yaunoda vhezheni yeDocker nemirairo inotevera:

sudo apt-get gadzira docker-ce =

Iwe unogona kutsiva iyo neshanduro yaunoda kuisa sezvakaratidzwa mune iri pamusoro rondedzero.

Semuyenzaniso:

sudo apt-get put docker-ce = 18.03.1 ~ ce-0 ~ debian

Nhanho 4: Mhanya iyo Docker Command isina Sudo

By default, iwe uchafanirwa kumhanya Docker kuraira uine sudo ropafadzo. Kana iwe uchida kumhanyisa Docker kuraira pasina kutaura iyo sudo command, saka iwe uchafanirwa kuwedzera yako zita rezita kuboka reDocker.

Iwe unogona kuwedzera zita rako rezita kuboka reDocker nemirairo inotevera:

sudo usermod -aG docker zita rekushandisa

Zvino, buda kubva kuseva uye upinde zvakare neako rako rezita kukumbira kune iyo itsva yeboka nhengo. Zvino, iwe unogona kumhanya chero Docker kuraira pasina kutaura sudo neDocker.

Kubata naDocker

Panguva ino, Docker yakaiswa uye inoshanda pane yako system. Iye zvino, isu tichadzidza nzira yekudhirowa mufananidzo uye kumhanya mudziyo neDocker.

Kutanga, tsvaga mifananidzo yese iripo yeDebian inoshanda system nemirairo inotevera:

docker kutsvaga debian

Iwe unofanirwa kuona iyo yese mifananidzo mune inotevera kubudiswa:

ZITA DESCRIPTION STARS OFFICIAL AUTOMATED ubuntu Ubuntu is a Debian-based Linux operating sys… 9956 [OK] debian: jessie 3214 [OK] arm32v7 / debian Debian kugoverwa kweLinux ndiko kunoumbwa… 60 samueldebruyn / debian-git chidiki docker mudziyo une debian uye g… 25 [OK] i64 / debian Debian kugoverwa kweLinux ndiko kunoumba… 8 multarch / debian-debootstrap multiarch ports ye debian-debootstrap 21 eboraas / debian Debian base mifananidzo, kune ese aripo-availa… 21 [OK] vergissberlin / debian-development Docker debian mufananidzo wekushandisa mukusimudzira,… 386 [OK] debian / eol End yeLife Debian vhezheni (zvichinongedzera pane arc… 10 smartentry / debian debian ne smartentry 9 [OK] ppc8le / debian Debian kugoverwa kweLinux ndiko compos ... 6 vicamo / debian Debian docker mifananidzo yeshanduro dzese / archit… 5 s4x / debian Debian is kugoverwa kweLinux kwakanyorwa… 64 arm4v3 / debian Debian kugoverwa kweLinux kwakanyorwa… 390 vpgrp / debian Docker mifananidzo yaDebian. 2 holgerimbery / debian debian multarch docker base mufananidzo 32 dockershelf / debian Repository ye docker mifananidzo yeDebian. Bvunzo… 5 [OK] nyama yekugaya / debian Debian base mifananidzo yekugadzira uye multis… 2 [OK] spritsail / debian-builder A Docker image based on debian: slim ideal fo… 2 [OK] casept / debian-amd1 A debian image built kubva pakutanga. Kunyanya fo… 1 amd0 / debian Debian kugoverwa kweLinux ndiko kunoumba… 0 jdub / debian-sources-sosi Concourse CI sosi yekutarisa kuti yakagadziridzwa D… 64 [OK] 0and64internet / debian-0-nginx-php-0-wordpress- 1 debian-1-nginx-php-9-izwi-7.2 4

Iye zvino, tora vhezheni yazvino yeiyo dhiabhori mufananidzo kubva pamusoro runyorwa nemutemo unotevera:

docker dhiza debian

Paunenge uchinge watora, iwe unofanirwa kuwana zvinotevera zvinotevera:

Kushandisa default tag: ichangoburwa

Iwe unogona zvakare kunyora iyo yakadhindwa mufananidzo neinotevera rairo:

docker mifananidzo

Iwe unofanirwa kuwana zvinhu zvinotevera:

REPOSITORY TAG IMAGE ID Yakagadzirwa SIZE yekupedzisira c2c03a296d23 6 mazuva apfuura 114MB

Iye zvino, mhanya mudziyo uchishandisa iyo yazvino Debian mufananidzo neinotevera rairo:

docker kumhanya -it debian

Iwe unofanirwa kuwana dhizaini yemudziyo weDebhiya:

[email protected]: / #

Iwe unogona kubuda kubva mumudziyo nemirairo inotevera:

[email yakadzivirirwa]: / # kubuda

Iwe unogona zvakare kunyora chako chinoshanda kana chisingaite mumidziyo neinotevera rairo:

docker ps -a

Chikwata:

CONTAINER ID IMAGE KUSIMBISA KUSIMBISA STATUS PORTS MAZITA 114ef7960999 debian "bash" Inenge maminetsi apfuura Exited (0) masekondi 16 apfuura sharp_booth

Iwe zvakare unogona kutanga mudziva wechiDhigan nekutsanangudza Container ID (114ef7960999) sezvakaratidzwa pasi apa:

docker mudziyo kutanga 114ef7960999

Ikozvino, batanidza iro dhizaini remudziyo weDebhiya mudziyo nemirairo inotevera:

docker inobatanidza 114ef7960999 Kubuda: [email yakadzivirirwa]: / #

Delete Docker Container uye Image

Iwe unogona nyore nyore kubvisa zvisina kushandiswa midziyo uye mifananidzo iyo inoshandisa yakakosha dhisiki nzvimbo.

Kuti ubvise mudziyo weDocker, tanga kunyora zvese mumudziyo nemirairo inotevera:

docker mudziyo ls -a

Unofanirwa kuona zvinotevera:

CONTAINER ID IMAGE KUSIMBIRA KUSIMBISA STATUS PORTS MAZITA 114ef7960999 debian "bash" maawa 19 apfuura Exited (0) maawa 19 apfuura sharp_booth

Tevere, kana mudziyo wako uchimhanya, unofanirwa kumira mudziyo usati wabvisa.

Iwe unogona kumisa mudziyo unomhanya nemirairo inotevera:

docker container kumira 114ef7960999

Tevere, bvisa mudziyo nemirairo inotevera:

docker mudziyo rm 114ef7960999

Iwe unogona zvakare kubvisa ese amiswa midziyo nekumhanya chete unotevera kuraira:

docker mudziyo Prune

Iwe unofanirwa kuona iyo inotevera yambiro yambiro:

Yambiro! Izvi zvinobvisa zvese zvakamiswa mumidziyo. Une chokwadi here kuti unoda kuenderera? [y / N] y

Type y ndokurova Enter kuti ienderere mberi:

Deleted Containers:
114ef7960999f41bb9c4bba2cf5c28e425a00175ab20ed739213f16961b3897e

Total reclaimed space: 35B

Kuti ubvise iyo Docker mufananidzo, unofanirwa kutsvaga ID yemufananidzo waunoda kubvisa.

Iwe unogona kuwana iyo ID ID nemirairo inotevera:

docker mufananidzo ls

Chikwata:

REPOSITORY TAG IMAGE ID Yakagadzirwa SIZE yekupedzisira c2c03a296d23 7 mazuva apfuura 114MB

Zvino, bvisa mufananidzo wacho neinotevera rairo:

docker mufananidzo rm c2c03a296d23

Iwe unofanirwa kuwana zvinhu zvinotevera:

Untagged: debian:latest
Untagged: [email protected]:e25b64a9cf82c72080074d6b1bba7329cdd752d51574971fd37731ed164f3345
Deleted: sha256:c2c03a296d2329a4f3ab72a7bf38b78a8a80108204d326b0139d6af700e152d1
Deleted: sha256:78c1b9419976227e05be9d243b7fa583bea44a5258e52018b2af4cdfe23d148d

Tarira: Kuti ubvise mufananidzo, unofanirwa kutanga wabvisa mudziyo.

Iwe unogona zvakare kubvisa ese asina kushandiswa mifananidzo panguva nekumhanya chete unotevera kuraira:

docker mufananidzo prune -a

Mune iyo yepamusoro dzidzo, isu takadzidza nzira yekuisa Docker pane Debian 10 VPS. Isu takadzidzawo nzira yekukwevera mufananidzo, mhanyisa mudziyo, tanga nekumisa mudziyo.