Skip to content

Commit 53af14a

Browse files
committed
Simplify DSC example
1 parent 39efa4f commit 53af14a

3 files changed

Lines changed: 15 additions & 42 deletions

File tree

dsc/Dockerfile

100755100644
Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
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 .\test.ps1

dsc/README.md

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,19 @@
11
# Desired State Configuration - DSC
22

3-
## Build dsc base image
3+
## Build an image and install software with PowerShell DSC
44

55
```
66
docker 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

dsc/test.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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

0 commit comments

Comments
 (0)