Completek8s Classroomnotes 16/Jul/2023

Containers on Windows

  • Lets build a windows container
    • Lets create an iis server and copy the html file index.html
  • manual steps
docker container run -it -p 80 --name trail powershell
Install-WindowsFeature -name Web-Server -IncludeManagementTools
  • The basic Dockerfile
LABEL author=khaja
RUN ["powershell", "Install-WindowsFeature", "-name",  "Web-Server",  "-IncludeManagementTools"]
ADD index.html C:/inetpub/wwwroot
CMD ["cmd.exe"]
  • build the image and run the continer
  • If you want to run the .net framework images Refer Here for sdk images
  • aspnet docker images Refer Here
  • I have pulled
docker pull
docker pull
  • Multistage dotnet build
FROM As builder

WORKDIR c:/src/MusicStore
COPY . C:/src/MusicStore
RUN nuget restore MvcMusicStore/packages.config -SolutionDirectory .
RUN msbuild MvcMusicStore.sln /p:OutputPath:c:\out /p:Configuration:Release

COPY --from=builder C:\out\_PublishedWebsites\MvcMusicStore C:\MvcMusicStore
RUN New-WebSite -Name "MvcMusicStore" -Port 80 -HostHeader "MvcMusicStore" -PhysicalPath "C:\MvcMusicStore"
  • Lets deal with volumes in windows
  • pull the image
docker image pull
  • Create a simple Docker file

VOLUME c:\app\logs
USER ContainerAdminstrator

Docker Registries

  • Create a spring petclinic docker image on a linux instance
  • Build the image
  • Docker images are stored in registries.
  • Each registry will have multiple repositories
  • Each repository can store multipe tags of the docker image
  • The default docker registry is docker hub
  • Repository name => username/reponame
  • specific image => Repo:tag => username/repo:tag
  • After building the image tag the image with new naming format docker image tag spc:latest shaikkhajaibrahim/spcjuly23:2.4.2-jdk11

Docker hub

  • To connect to docker hub
docker login

* now push the image

docker image push shaikkhajaibrahim/spcjuly23:2.4.2-jdk11

* Refer Here for image info
* Now anyone connected to docker hub can run this application

docker container run -d -P --name spc1 shaikkhajaibrahim/spcjuly23:2.4.2-jdk11


  • Try pushing your images to
    • docker hub
    • aws ecr
    • azure acr

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner