File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM microsoft/windowsservercore
2-
3- RUN powershell -Command Add-WindowsFeature Dsc-Service
4-
5- # COPY . c:\code
6- # WORKDIR c:\\code
7-
8- # RUN .\test.ps1
9-
10- # RUN start-dscconfiguration . -verbose -wait
1+ FROM microsoft/windowsservercore
2+ COPY test.ps1 test.ps1
3+ RUN powershell .\t est.ps1
Original file line number Diff line number Diff line change 11# Desired State Configuration - DSC
22
3- ## Build dsc base image
3+ ## Build an image and install software with PowerShell DSC
44
55```
66docker build -t dsc .
77```
88
9- ### Run example
10-
11- Run an interactive Windows container to test DSC in a clean environment.
12-
139```
14- docker run -it -v "$(pwd):c:\code" dsc powershell
10+ $ docker history dsc
11+ IMAGE CREATED CREATED BY SIZE COMMENT
12+ 7b58a23478f9 23 seconds ago cmd /S /C powershell .\test.ps1 269 MB
13+ efb8dc939bf5 About a minute ago cmd /S /C #(nop) COPY file:56bbc9d994e00b0... 41.2 kB
14+ 590c0c2590e4 3 weeks ago Install update 10.0.14393.1066 2.47 GB
15+ <missing> 5 months ago Apply image 10.0.14393.0 7.68 GB
1516```
1617
17- Create the mof file for this container node:
1818
19- ```
20- cd C:\code
21- .\test.ps1
22- ```
23-
24- Now run the DSC configuration
25-
26- ```
27- Start-DSCConfiguration . -verbose -wait
28- ```
29-
30- ## Is it useful inside containers?
31-
32- Pushing the dsc base image to Docker hub shows that you need about 290 MByte to have DSC installed.
33-
34- ```
35- $ docker push stefanscherer/dsc
36- The push refers to a repository [docker.io/stefanscherer/dsc]
37- bc61b38bd60a: Pushing 247.3 MB/293.6 MB
38- b9454c3094c6: Skipped foreign layer
39- 3fd27ecef6a3: Skipped foreign layer
40- ```
19+ More infos can be found at https://github.com/artisticcheese/artisticcheesecontainer/wiki
Original file line number Diff line number Diff line change 1- Configuration DemoWebSeite
1+ Configuration DemoWebSite
22{
33 Node $ (hostname)
44 {
@@ -10,5 +10,6 @@ Configuration DemoWebSeite
1010 }
1111}
1212
13- # create .mof file
14- DemoWebSeite - OutputPath c:\code
13+ DemoWebSite - OutputPath .\demo
14+ Start-DscConfiguration - Wait - Verbose - Path .\demo - Force
15+ Remove-Item .\demo - Force - Recurse
You can’t perform that action at this time.
0 commit comments