First actions to get going with Containers and Docker
Get going with first actions with containers on Windows Server
December 8, 2016
Q. What are some key actions to perform when first using Containers on Windows Server 2016?
A. Once you have installed a container host you likely want to actually create a container. By default an install of Containers configures a NAT network which enables containers created to be accessible from the network using the IP address of the container host.
The first step is to download a container OS image. Normally you will want the NanoServer image and the ServerCore image. These can be downloaded as follows:
Open up an elevated command prompt
Run the commands:
docker images (currently no images)
docker pull microsoft/windowsservercore
docker pull nanoserver/iis
docker images (now have images)You can now create a container instance running Server Core that you can interact with:
docker run -it microsoft/windowsservercore cmd.exe
exit (when finished)The container still exists but has existed (since its task, cmd.exe has completed)
docker ps -aTo delete the container run
docker rm
For example:
C:Windowssystem32>docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES87604fa30100 microsoft/windowsservercore "cmd.exe" 9 seconds ago Exited (0) 2 seconds ago infallible_bartikC:Windowssystem32>docker rm 87604fa3010087604fa30100C:Windowssystem32>docker ps -aCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
While you could create a custom image with IIS, for example, you can search the repository for an existing image:
docker search iisdocker pull microsoft/iis
You can now create container instances based on the IIS and customize but that is more advanced. For now you have used a container!
About the Author
You May Also Like