New-Item -Path c: \docker -ItemType Directory -Force # Install PSDSC resource modules ADD cChoco c:\docker RUN powershell -Command Get-ChildItem -Path c: \docker The Dockerfile then adds this directory to the image before the configuration is applied.įROM windowsservercore MAINTAINER LABEL Description="PowerShell Desired State Configuration" Vendor="Nicholas Dille" Version="0.1" # Install Windows features RUN powershell -Command \Īdd-WindowsFeature -Name Dsc-Service -Verbose # Create directory for persistent files RUN powershell -Command \ The build script (called docker-build.cmd) downloads the module containing the DSC resource cChoco required for the configuration. The node configuration requires a DSC resource because only few are builtin with DSC after installation of the DSC feature. I have decided to use Chocolatey to install packages during the image creation process. Before DSC will work, it is necessary to install an additional Windows feature called Dsc-Service. The first example integrates a simple node configuration into the container image. Example 1: Handling the Node Configuration Consequently, the node configuration needs to be separated into an image specific and an instance specific part. In the context of an container, the image serves a very specific purpose and, therefore, it is configured with certain binaries and configuration options. The node configuration is usually considered to be highly individual. ![]() Although many of the configuration options specify global behaviour, there is the so-called configuration ID identifying the node with an individual name. Although it works out of the box, the LCM is highly configurable using the meta configuration. Update: Please also read my [follow-up post about PowerShell Desired State Configuration in containers[(/blog/8/use-powershell-desired-state-configuration-only-for-docker-image-builds/).ĭesired State Configuration implements the Local Configuration Manager (LCM) which is responsible for applying the node configuration. I have created two examples to demonstrate this. After posting how Microsoft has integrated the Docker engine with containers in Windows Server 2016 TP5, I started investigating how PSDSC can be used in container. You have probably noticed my enthusiasm for PowerShell Desired State Configuration (PSDSC). Tags #Docker #Container #PSDSC #PowerShell #Desired State Configuration #DSC #PowerShell Desired State Configuration IT administrators with limited scripting experience will also find this book a useful overview of what DSC offers and how to use DSC resources to automate configuration management and deployment.#PowerShell Desired State Configuration (#PSDSC) in Windows Containers using #Docker With a little prior PowerShell scripting experience, this book can be used as an in-depth reference to creating, customizing, and extending DSC in Windows. IT administrators, developers and DevOps engineers working in Windows-based data center environments. Apply DSC in the cloud with Microsoft Azure or Amazon Web Services or Google Cloud Platform.Find out why and how DSC has an important role to play in public and private cloud deployments. ![]() Learn to think and act like a developer when automating your configuration management, creating a testable, robust process that you can use again and again.Integrate DSC into build and release management tools. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |