PowerShell ile Docker EE kurulumu (tr-TR)

%3CLINGO-SUB%20id%3D%22lingo-sub-1848818%22%20slang%3D%22en-US%22%3EPowerShell%20ile%20Docker%20EE%20kurulumu%20(tr-TR)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1848818%22%20slang%3D%22en-US%22%3E%3CP%3EWindows%20Server%202016%20ile%20hayat%C4%B1m%C4%B1za%20giren%20container%20%C3%B6zelli%C4%9Finden%20sizlere%20biraz%20bahsetmek%20ve%20Windows%20Server%202019%20%C3%BCzerinde%20container%20teknolojisinin%20%C3%B6nc%C3%BCs%C3%BC%20olan%20docker%20kurulumunun%20nas%C4%B1l%20yapaca%C4%9F%C4%B1n%C4%B1z%C4%B1%20size%20anlatmak%20isterim.%20Sanalla%C5%9Ft%C4%B1rma%20teknolojisinin%20ard%C4%B1ndan%20g%C3%BCndemimize%20h%C4%B1zl%C4%B1%20bir%20giri%C5%9F%20yapan%20container%20mimarisi%20%C3%B6zelikle%20yaz%C4%B1l%C4%B1mc%C4%B1lar%C4%B1n%20%C3%A7ok%20k%C4%B1sa%20s%C3%BCrede%20vazge%C3%A7ilmesi%20olmaya%20ba%C5%9Flam%C4%B1%C5%9Ft%C4%B1r.%20Ayn%C4%B1%20i%C5%9Fletim%20sistemi%20i%C3%A7erisinde%20ayn%C4%B1%20kaynaklar%C4%B1%20kullanarak%20olu%C5%9Fturulan%20ve%20ihtiya%C3%A7%20durumunda%20kaynaklar%C4%B1n%20%C3%A7ok%20rahat%20azalt%C4%B1larak%20yada%20artt%C4%B1r%C4%B1labilen%20bir%20alt%20yap%C4%B1ya%20sahip%20olan%20container%20teknolojisi%20kendi%20dosya%20sistemi%2C%20registry%20ve%20a%C4%9F%20adreslerine%20sahip%20olabildi%C4%9Fi%20i%C3%A7in%20di%C4%9Fer%20uygulamalardan%20da%20izole%20bir%20%C5%9Fekilde%20%C3%A7al%C4%B1%C5%9Fma%20imkan%C4%B1%20sunmaktad%C4%B1r.%20Esnek%20kullan%C4%B1m%20yap%C4%B1s%C4%B1%20ile%20uygulama%20geli%C5%9Ftiricilerin%20tercih%20sebebi%20olmu%C5%9Ftur.%20Peki%20bu%20container%20role%20kurulumu%20nas%C4%B1l%20yap%C4%B1l%C4%B1r%20sunucuda%20nas%C4%B1l%20aktif%20edilir%20birlikte%20bakal%C4%B1m.%20Container%20role%20kurulumunu%20docker%20ile%20e%C5%9F%20zamanl%C4%B1%20sizlere%20anlatmaya%20%C3%A7al%C4%B1%C5%9Faca%C4%9F%C4%B1m.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EDocker%20EE%20Kurulumu%20%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EModul%20kurulumu%20i%C3%A7in%20%22Install-Module%22%20komutu%20ile%20kuruluma%20ba%C5%9Fl%C4%B1yoruz.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EInstall-Module%20DockerMsftProvider%20-Force%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EEkran%20%C3%A7%C4%B1kt%C4%B1s%C4%B1%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CUsers%5CAdministrator%26gt%3B%20Install-Module%20DockerMsftProvider%20-Force%0A%20%0ANuGet%20provider%20is%20required%20to%20continue%0APowerShellGet%20requires%20NuGet%20provider%20version%20'2.8.5.201'%20or%20newer%20to%20interact%20with%0ANuGet-based%20repositories.%20The%20NuGet%20provider%20must%20be%20available%20in%20'C%3A%5CProgram%0AFiles%5CPackageManagement%5CProviderAssemblies'%20or%0A'C%3A%5CUsers%5CAdministrator%5CAppData%5CLocal%5CPackageManagement%5CProviderAssemblies'.%20You%20can%0Aalso%20install%20the%20NuGet%20provider%20by%20running%20'Install-PackageProvider%20-Name%20NuGet%0A-MinimumVersion%202.8.5.201%20-Force'.%20Do%20you%20want%20PowerShellGet%20to%20install%20and%20import%20the%0ANuGet%20provider%20now%3F%0A%5BY%5D%20Yes%20%20%5BN%5D%20No%20%20%5BS%5D%20Suspend%20%20%5B%3F%5D%20Help%20(default%20is%20%22Y%22)%3AY%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EDocker%20paketlerini%20y%C3%BCklemek%20i%C3%A7in%20%22Install-Package%22%20komutunu%20kullan%C4%B1yoruz.%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EInstall-Package%20Docker%20-ProviderName%20DockerMsftProvider%20-Force%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EEkran%20%C3%87%C4%B1kt%C4%B1s%C4%B1%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CUsers%5CAdministrator%26gt%3B%20Install-Package%20Docker%20-ProviderName%20DockerMsftProvider%20-Force%0AWARNING%3A%20A%20restart%20is%20required%20to%20enable%20the%20containers%20feature.%20Please%20restart%20your%20machine.%0A%20%0AName%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Version%20%20%20%20%20%20%20%20%20%20Source%20%20%20%20%20%20%20%20%20%20%20Summary%0A----%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20-------%20%20%20%20%20%20%20%20%20%20------%20%20%20%20%20%20%20%20%20%20%20-------%0ADocker%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2018.09.4%20%20%20%20%20%20%20%20%20%20DockerDefault%20%20%20%20Contains%20Docker%20EE%20...%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EDocker%20%C3%A7al%C4%B1%C5%9Ft%C4%B1mak%20i%C3%A7in%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3Edocker%20container%20run%20hello-world%3Ananoserver%3C%2FCODE%3E%3C%2FPRE%3E%3CPRE%20class%3D%22lia-code-sample%20language-powershell%22%3E%3CCODE%3EPS%20C%3A%5CUsers%5CAdministrator%26gt%3B%20docker%20container%20run%20hello-world%3Ananoserver%0AUnable%20to%20find%20image%20'hello-world%3Ananoserver'%20locally%0Ananoserver%3A%20Pulling%20from%20library%2Fhello-world%0A6a5e981230da%3A%20Pull%20complete%0Adc4b656f6979%3A%20Pull%20complete%0A2848c5402b33%3A%20Pull%20complete%0A9e0171b11ac8%3A%20Pull%20complete%0ADigest%3A%20sha256%3Aea56d430e69850b80cd4969b2cbb891db83890c7bb79f29ae81f3d0b47a58dd9%0AStatus%3A%20Downloaded%20newer%20image%20for%20hello-world%3Ananoserver%0A%20%0AHello%20from%20Docker!%0AThis%20message%20shows%20that%20your%20installation%20appears%20to%20be%20working%20correctly.%0A%20%0ATo%20generate%20this%20message%2C%20Docker%20took%20the%20following%20steps%3A%0A%201.%20The%20Docker%20client%20contacted%20the%20Docker%20daemon.%0A%202.%20The%20Docker%20daemon%20pulled%20the%20%22hello-world%22%20image%20from%20the%20Docker%20Hub.%0A%20%20%20%20(windows-amd64%2C%20nanoserver-1809)%0A%203.%20The%20Docker%20daemon%20created%20a%20new%20container%20from%20that%20image%20which%20runs%20the%0A%20%20%20%20executable%20that%20produces%20the%20output%20you%20are%20currently%20reading.%0A%204.%20The%20Docker%20daemon%20streamed%20that%20output%20to%20the%20Docker%20client%2C%20which%20sent%20it%0A%20%20%20%20to%20your%20terminal.%0A%20%0ATo%20try%20something%20more%20ambitious%2C%20you%20can%20run%20a%20Windows%20Server%20container%20with%3A%0A%20PS%20C%3A%5C%26gt%3B%20docker%20run%20-it%20mcr.microsoft.com%2Fwindows%2Fservercore%20powershell%0A%20%0AShare%20images%2C%20automate%20workflows%2C%20and%20more%20with%20a%20free%20Docker%20ID%3A%0A%20https%3A%2F%2Fhub.docker.com%2F%20Jump%0A%20%0AFor%20more%20examples%20and%20ideas%2C%20visit%3A%0A%20https%3A%2F%2Fdocs.docker.com%2Fget-started%2F%20%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1848818%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3Epowershell%20ile%20docker%20kurulumu%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EWindows%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Contributor

Windows Server 2016 ile hayatımıza giren container özelliğinden sizlere biraz bahsetmek ve Windows Server 2019 üzerinde container teknolojisinin öncüsü olan docker kurulumunun nasıl yapacağınızı size anlatmak isterim. Sanallaştırma teknolojisinin ardından gündemimize hızlı bir giriş yapan container mimarisi özelikle yazılımcıların çok kısa sürede vazgeçilmesi olmaya başlamıştır. Aynı işletim sistemi içerisinde aynı kaynakları kullanarak oluşturulan ve ihtiyaç durumunda kaynakların çok rahat azaltılarak yada arttırılabilen bir alt yapıya sahip olan container teknolojisi kendi dosya sistemi, registry ve ağ adreslerine sahip olabildiği için diğer uygulamalardan da izole bir şekilde çalışma imkanı sunmaktadır. Esnek kullanım yapısı ile uygulama geliştiricilerin tercih sebebi olmuştur. Peki bu container role kurulumu nasıl yapılır sunucuda nasıl aktif edilir birlikte bakalım. Container role kurulumunu docker ile eş zamanlı sizlere anlatmaya çalışacağım.

 

Docker EE Kurulumu

Modul kurulumu için "Install-Module" komutu ile kuruluma başlıyoruz. 

 

Install-Module DockerMsftProvider -Force

Ekran çıktısı:

PS C:\Users\Administrator> Install-Module DockerMsftProvider -Force
 
NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with
NuGet-based repositories. The NuGet provider must be available in 'C:\Program
Files\PackageManagement\ProviderAssemblies' or
'C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssemblies'. You can
also install the NuGet provider by running 'Install-PackageProvider -Name NuGet
-MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import the
NuGet provider now?
[Y] Yes  [N] No  [S] Suspend  [?] Help (default is "Y"):Y

Docker paketlerini yüklemek için "Install-Package" komutunu kullanıyoruz. 

Install-Package Docker -ProviderName DockerMsftProvider -Force

Ekran Çıktısı:

PS C:\Users\Administrator> Install-Package Docker -ProviderName DockerMsftProvider -Force
WARNING: A restart is required to enable the containers feature. Please restart your machine.
 
Name                           Version          Source           Summary
----                           -------          ------           -------
Docker                         18.09.4          DockerDefault    Contains Docker EE ...

Docker çalıştımak için

docker container run hello-world:nanoserver
PS C:\Users\Administrator> docker container run hello-world:nanoserver
Unable to find image 'hello-world:nanoserver' locally
nanoserver: Pulling from library/hello-world
6a5e981230da: Pull complete
dc4b656f6979: Pull complete
2848c5402b33: Pull complete
9e0171b11ac8: Pull complete
Digest: sha256:ea56d430e69850b80cd4969b2cbb891db83890c7bb79f29ae81f3d0b47a58dd9
Status: Downloaded newer image for hello-world:nanoserver
 
Hello from Docker!
This message shows that your installation appears to be working correctly.
 
To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (windows-amd64, nanoserver-1809)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.
 
To try something more ambitious, you can run a Windows Server container with:
 PS C:\> docker run -it mcr.microsoft.com/windows/servercore powershell
 
Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/ Jump
 
For more examples and ideas, visit:
 https://docs.docker.com/get-started/ 

 

 

 

 

 

 

0 Replies