Access this Gist via this shortened URL: https://git.io/vPj49
If anything changes, with regards to the material covered in this course, this will be the first place I share updates.
Access this Gist via this shortened URL: https://git.io/vPj49
If anything changes, with regards to the material covered in this course, this will be the first place I share updates.
docker pull
, comes down as an image which is much like a zip file or msi installer. An image is an application packaging format.docker create.
docker run
to orchestrate all of these steps with one command, how convenient!docker exec
can be thought of as running another copy of our installed software, like when we launch an executable twice. For example, two copies of Microsoft Word. Or with MongoDB, we might run two mongo clients. After a container is created and running, we can use docker exec to run multiple applications, or multiple copies of the same app, inside the container.# DISCLAIMER: I cannot guarantee the safety of any image | |
# Use your judgement before running software you download from the internet | |
# Open PowerShell | |
# 1. nmap (linux container) | |
# Port scan your home network | |
# - Replace 192.168.0.0 with your network | |
# - Don't be scanning networks you don't own! | |
# https://hub.docker.com/r/weshigbee/nmap/ | |
docker run --rm ` | |
weshigbee/nmap -v 192.168.0.0/24 | |
# 2. ffmpeg (linux container) | |
# - Replace Turkey.mp4 with whatever movie you'd like to turn into an animated gif | |
# - Turkey Video: http://www.weshigbee.com/wp-content/uploads/2014/12/Turkey-Short.mp4 | |
# - http://bit.ly/2fcrRK2 | |
# https://hub.docker.com/r/jrottenberg/ffmpeg/ | |
docker run --rm ` | |
# mount host's current directory as /output inside container | |
--volume ${pwd}:/output ` | |
jrottenberg/ffmpeg -i http://bit.ly/2fcrRK2 /output/Turkey.gif | |
# 3. .NET Core (linux container) | |
# Make a sample ASP.NET Core web app | |
# https://hub.docker.com/r/microsoft/dotnet/ | |
mkdir web-dotnet | |
# - A Get help | |
docker run --rm \ | |
microsoft/dotnet \ | |
dotnet help new | |
# - Create web sample | |
docker run --rm \ | |
--volume $(pwd)/web-dotnet:/workspace \ | |
--workdir /workspace \ | |
microsoft/dotnet \ | |
dotnet new -t web | |
# - Run shell | |
docker run --rm \ | |
--volume $(pwd)/web-dotnet:/workspace \ | |
--workdir /workspace \ | |
-p 5000:5000 \ | |
-it \ | |
microsoft/dotnet \ | |
bash | |
# then run these in bash shell in container: | |
dotnet restore | |
export ASPNETCORE_URLS=http://+:5000 | |
dotnet run & | |
curl localhost:5000 |
Docker : A front end for managing continers.
# Source: https://msdn.microsoft.com/en-us/virtualization/windowscontainers/deployment/deployment | |
#replace with the virtual machine name | |
$vm = "Win10DockerGettingStarted" | |
#configure virtual processor | |
Set-VMProcessor -VMName $vm -ExposeVirtualizationExtensions $true -Count 2 | |
#disable dynamic memory | |
Set-VMMemory $vm -DynamicMemoryEnabled $false -StartupBytes 8GB | |
#enable mac spoofing | |
Get-VMNetworkAdapter -VMName $vm | Set-VMNetworkAdapter -MacAddressSpoofing On |
# Solitaire static web site | |
# 1. Use volume mounts to host static site | |
docker run --rm -it ` | |
-v ${pwd}/app:/usr/share/nginx/html ` | |
-p 8080:80 ` | |
nginx | |
docker run --rm -it ` | |
-v ${pwd}/app:/usr/share/nginx/html ` | |
-p 8080:80 ` | |
microsoft/iis | |
# 2. Copy files into container | |
docker run -d -p 8080:80 --name nginx nginx | |
docker cp app/. nginx:/usr/share/nginx/html | |
# 3. Commit container to make an image! | |
docker commit nginx solitaire:nginx | |
# 4. Dockerfile (save the two lines below in a file called Dockerfile) | |
FROM nginx | |
COPY app /usr/share/nginx/html | |
# build | |
docker build -t solitaire:nginx-dockerfile . | |
# MSSQL | |
# SSMS Management Tools free download: https://msdn.microsoft.com/en-us/library/mt238290.aspx |
Things to read and/or subscribe to: