DEV Community

velan
velan

Posted on

Exploring files inside of docker container in windows

Recently i got interested to explore whats inside of an docker image. How the files would have been organized?. Lets find out.

Prerequesite
  • Running docker image
  • Powershell

I have took two images for exploration,

docker ps
Enter fullscreen mode Exit fullscreen mode

docker-ps

  1. firstcontainer .Net Core mvc (.net core 2+)
  2. ctiqaui .Net Framework mvc (Mvc 5)
docker exec -t -i firstContainer powershell
Enter fullscreen mode Exit fullscreen mode

The above command will open the powershell terminal inside of docker directory.

docker-exce

docker-pw

Great!. We are inside of docker!!

Now we can use regular windows commands to explore the directories.

ls
Enter fullscreen mode Exit fullscreen mode

docker ls

so the app folder consist of all the complied codes of .net core app.

lets explore root directory.

cd ..
ls
Enter fullscreen mode Exit fullscreen mode

docker cd

We can see docker windows image files and app folder to host .net core app.

Lets open up .net framework MVC5 app container and compare with .net core.

docker mvc

It contains windows server core file and IIS to host mvc 5 app.

To come out of the powershell session just press

ctrl + z
Enter fullscreen mode Exit fullscreen mode

Discussion (0)