-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-script.ps1
80 lines (53 loc) · 2.01 KB
/
demo-script.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<#
## Demo Reset
docker rm -f $(docker ps -a -q)
# Cache Images
docker pull microsoft/windowsservercore
docker pull microsoft/nanoserver:latest
docker pull microsoft/dotnet:nanoserver
docker pull microsoft/dotnet-samples:dotnetapp-nanoserver
docker pull microsoft/iis
docker pull microsoft/aspnet
docker pull microsoft/mssql-server-windows
#>
##1 - Show Docker running on Windows 10
# Show the Client and Server version for Docker.
docker version
# Show the Server OS/Arch setting, either 'windows/amd64' or 'linux/amd64'.
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
# Show the Server OS/Arch setting has changed.
docker version
# Switch to Hyper-V Manager Show the 'MobyLinuxVM' running.
# Switch back to being able to run Windows containers.
& 'C:\Program Files\Docker\Docker\DockerCli.exe' -SwitchDaemon
# List images in the local repository.
docker images
# Get an image from Docker Hub.
docker pull microsoft/dotnet-samples:dotnetapp-nanoserver
# Remove a local image
docker rmi microsoft/iis
##2 Manage Containers
# Run a container
docker run microsoft/dotnet-samples:dotnetapp-nanoserver
# List all containers, including stopped containers
docker ps -a
# Run an existing, stopped container
$containerID = (docker ps -a |Out-GridView -PassThru).Substring(0, 12)
docker start -ia $containerID
##3 Dockerize a .NET Console Application
# Move to the project directory.
cd 'C:\Projects\ContainersForWindowsDevs\HelloWorldConsole\HelloWorldConsole\'
# Create the image (don't forget the '.')
docker build -t helloworldconsole:windevug .
# Show the image just created.
docker images
# Run the image, specifying the input parameter. Using "--rm" will remove the container after it exits.
docker run --rm helloworldconsole:windevug "mike"
# Show the container is not available
docker ps -a
##4 - SQL Server vNext in a Container
# Go to "SQL vNext Containers Demo.ps1"
##5 - Visual Studio 2017 (Docker Tools)
# See Demo Script.docx
##6 - Docker Compose w/ ASP.NET MVC and SQL Server
# See Demo Script.docx