Sida loo sameeyo oo loo isticmaalo Docker Desktop ee Windows

Ma(Are) waxaad tahay horumariye oo aad ku bilaabaysaa weel-samaynta? Kontaynarku(Containerization) waa isbeddelka cusub ee maalmahan wuxuuna ka dhigayaa nidaamka codsigaaga mid ku tiirsan oo la isku halayn karo. Haddii aad tahay qof bilow ah oo aad ku bilowday qalab sida Docker , markaa tani waa meesha saxda ah ee la joogo. Maqaalkan, waxaan ku soo qaadannay casharro ku saabsan sida loo dejiyo oo loo isticmaalo Docker mashiinka Windows . Nidaamku waxa uu u qaadanayaa in aad wax ka taqaanno fikradda weel dhigista.

Si aan kuu siiyo qeexitaan cad oo weel, waxaan si toos ah u jeclaan lahaa inaan soo xigto Docker :

A container is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably from one computing environment to another. A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.

Deji(Set) oo ku isticmaal Docker Desktop Windows

Docker wuxuu leeyahay kiis isticmaal oo badan. Kuwa ugu caansan iyaga waa weelka codsiyada jira. Waxa aad dib ugu xidhi kartaa codsiyadaada Java ama .NET weel aad loo qaadi karo oo loo diri karo server kasta. Laakiin si taas loo sameeyo, waxaad u baahan tahay inaad ka gudubto aasaaska. Haddaba aan bilowno oo aragno sida loogu rakibo Windows(Windows) .

1. Soo deji oo rakib dejinta. U gudub bogga Docker oo soo deji Docker Desktop ee Windows( Docker Desktop for Windows) . Marka la soo dejiyo, ku rakib kombuyutarkaaga adiga oo raacaya tilmaamaha fudud ee habaynta. Kumbiyuutarkaagu waxa laga yaabaa inuu dib u bilaabo dhawr jeer inta hawsha lagu jiro.

Docker Desktop ee Windows

2. Marka wax walba la rakibo, waxaad u baahan tahay inaad abuurto akoon. U gudub hub.docker.com oo samee akoon cusub. Hadda isticmaal isla koontada si aad u gasho adiga ku rakibida Windows . Samaynta akoonku gabi ahaanba waa bilaash waxna laguguma dalaci doono.

3. Qaybta dejinta hadda way dhammaatay. Waxaad ku xaqiijin kartaa in Docker uu socdo adiga oo aadaya system tray oo gujinaya astaanta nibiriga. Ama waxaad furi kartaa daaqada CMD oo aad fulin kartaa

docker --version

si aad u hubiso in aad Docker ku rakibtay kombayutarkaaga. Ama waxaad sidoo kale soo dejisan kartaa sawirka hello-world si aad u hubiso in wax waliba si fiican u shaqaynayaan. Isla daaqada CMD ku fuli docker run hello-world si aad u socodsiiso dhammaan jeegaga.

4. Hadda waxaad u baahan tahay sawir si aad u bilowdo weelkaaga ugu horreeya. Waxaa jira sawirro badan oo dadweyne oo loo heli karo ujeedooyin kala duwan. Waxaad aadi kartaa Docker hub oo ka raadi kartaa sawir kasta oo aad jeclaan lahayd. Waxaa jira sawirro loo heli karo WordPress , Ubuntu , Node.Js iwm. Tusaalahan, waxaanu ku dhejin doonaa sawirka WordPress weel maxalli ah si aad ugu socodsiiso weelka maxaliga ah ee WordPress kumbuyuutarkaaga.

5. Talaabada ugu horeysa ee abuurista weel kasta waxay abuureysaa faylka qaabeynta. Faylka qaabeynta ayaa qeexaya sawirka weelku isticmaali doono iyo cabbiraadaha. Markaa, samee gal cusub oo gudaha galkaas ku samee fayl cusub oo la yiraahdo docker-compose.yml. Ku dheji waxyaabaha soo socda oo kaydi faylka:

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
volumes:
    db_data: {}

Xigasho: Docker Documentation

6. Fur daaqada CMD ee galkan oo fuli

docker-compose up -d

si aad u bilowdo soo dejinta sawirada iyo dejinta weelka mashiinka deegaankaaga. Marka amarku dhameeyo fulinta, waxaad yeelan doontaa weel WordPress ah oo kor u qaadaya oo ku socda mashiinka deegaankaaga. Waxaad ka furi kartaa biraawsarkaaga adiga oo aadaya http://localhost:8000 .

Tani waxay ahayd sida aad u abuuri karto faylka qaabeynta ka dibna u soo dejisan karto waxyaabaha loo baahan yahay si aad ugu socodsiiso codsigaaga gudaha weelka. Xusuusnow(Remember) taas, waxaa jira fursado kale oo aad u badan oo la heli karo, boostadani waxay halkan u joogtaa inay ku siiso dulmar guud ee Docker iyo weelka. Waxaad internetka ka raadin kartaa faylal habayn badan ama xitaa waxaad samayn kartaa adiga kuu gaar ah. Waxa jira sawirro badan oo il furan oo bilaash ah oo Docker ah oo laga heli karo khadka kuwaas oo ku bilaabi kara.

Marka aad habayso sawirkaaga oo aad samayso isbeddellada lagama maarmaanka ah, waxa kale oo aad u riixi kartaa kaydka Docker Hub . Riix (Click) halkan(here)(here) si aad u soo dejiso Docker Desktop ee Windows . Wax dheeraad(Further) ah oo ku saabsan Docker for Windows halkan(here)(here) .



About the author

Waxaan ahay injineer software ah oo leh in ka badan 10 sano oo waayo-aragnimo ah naqshadaynta, dhisida, iyo ilaalinta codsiyada ku salaysan Windows. Waxaan sidoo kale ahay khabiir aad u yaqaan habaynta erayada, xaashida faafinta, iyo bandhigyada. Waxaan qori karaa sharraxaad cad oo kooban oo kood ah, waxaan u sharixi karaa fikrado kakan horumariyeyaasha cusub, oo aan xalliyo arrimaha duulista macaamiisha.



Related posts