Using a Dockerfile to create a custom container
You can use containers in various ways, depending on your needs. In most cases, you may find it useful to build custom container images, complete with an operating system, OS features, and applications. A great way to make your image is to use a Dockerfile containing the instructions for building a new image and then use the docker build command to create a customized container you can then run.
In this recipe, you create a custom container image that provides an IIS website.
Getting ready
In this recipe, you use the container host, CH1
, that you set up in the Configuring a container host recipe
How to do it...
- Creating folder and setting location to the folder on
CH1
$SitePath = 'C:\RKWebContainer'
$NewItemHT = @{
Path = $SitePath
ItemType = 'Directory'
ErrorAction = 'SilentlyContinue'
}
New-Item @NewItemHT | Out-Null
Set-Location -Path $SitePath
- Creating a script to run in the container...