Cheatography
https://cheatography.com
Useful commands from the course
This is a draft cheat sheet. It is a work in progress and is not finished yet.
Docker Analogy
LEGACY |
DOCKER |
COMMAND |
Find software |
Docker Hub |
Download software |
Pull an image |
docker pull |
Install software |
Create container from image |
docker create |
Start software |
Run the container |
docker start |
Stop software |
Stop the container |
docker stop |
Uninstall software |
Remove the container |
docker rm |
Not possible |
One command for everything!! |
docker run |
Windows Container Types
|
W.SERVER Container |
HYPER-V Container |
ISOLATION |
Process |
VM |
W.SERVER 2016 |
Yes |
Yes |
WINDOWS 10 |
No |
Yes |
Install Docker WS2016
1. |
Update Windows |
2. |
Install-Module -Name DockerMsftProvider -Repository PSGallery -Force |
3. |
Install-Package -Name docker -ProviderName DockerMsftProvider -Verbose |
Docker vs Traditional Sw
|
|
|
|
Commands
docker run -p 80:80 hello-world |
Basic hello-world container |
docker inspect iis |
Return low-level information on Docker objects (e.g: iis container) |
docker run --rm |
Remove container after it stops its execution |
docker run --isolation=hyperv |
Run container in hyperv isolation mode |
docker save microsoft/iis:nanoserver -o iis.tar |
Export image to .tar file |
docker run --rm -v c:/Users:/data alpine ls /data |
Mount drive |
docker run --rm -it -v c:/Users/wes:/wes apline tar -xf /wes/iis.tar -C iis |
Saving files from the container to the host |
docker run --rm -it -v c:/Users/wes:/wes alpine tar -xf /wes/iis.tar -C /wes/iis |
Unzipping tar in Linux and saving output in Windows |
Windows Examples
1. |
docker run microsoft/dotnet:nanoserver |
2. |
docker run -it microsoft/dotnet:nanoserver dotnet --version |
3. |
docker run -it microsoft/dotnet:nanoserver powershell |
|