Translate

Tuesday, August 29, 2017

Building a docker Image with iis and pre-requisites

Steps to do: 

- Run the container with the command  docker run -it 4f222 cmd.exe 
- Image which is run here microsoft/windowsservercore
- this should open the command prompt 
- then the navigate through the command prompt (to c:\ProgramFiles\powershell\powershell.exe) to get a powershell command prompt
- In the powershell execute: Install-WindowsFeature -Name Web-Server, Web-Mgmt-Tools
- Above commnand should enable IIS Server on the container and also install management tool for that 
- To test the successful installation of the web-server try executing the iisreset in the prompt, you should be able to see the iisreset message then. 
- To know the full folder name of the docker image we need to run the command: docker inspect -f '{{.Id}}'  e9bb03ced109(ContainerID)
- Best option is to mount a folder to the image and then have it as a part of the image so that it can be accessed within the image. 
- command to run in the mount mode: docker run -it 4f222 powershell.exe --mount type=bind,source=c:\Hackathon,target=c:\Hackathon (Some how this did not work today)
- Trying another suggestion form StackOverflow: https://stackoverflow.com/questions/40313633/how-to-copy-files-from-local-machine-to-docker-container-on-windows
- Container name is required to execute the command, to get the container name: 
docker ps --format "{{.Names}}"
- Modified command for this machine: 
docker cp c:\Hackathon sharp_euclid:c:\Hackathon

No comments:

Post a Comment