Running powershell or cmd on docker container

Viewed 7178

I want to check the content of my docker container. I want to run a powershell or command prompt inside container so I can list directories.

This container image is hosting ASP.NET Web API application using ASP.net 4.6.1 framework.

enter image description here

I ran following commands:

  1. docker container ls - to list conatiners
  2. docker exec -i -t a1da40af6b3c powershell

But nothing happens (as shown in the image). Am i missing anything?

2 Answers

ISE hosted powershell does not work properly with a bunch of things. So try to do this either inside standalone powershell console or use VS Code.

If you want to check the content of the docker container from a powershell or command prompt so that you can list directories, As shown in Screenshot.
Use Below command:
docker exec -it <docker_container_name/id> /bin/sh
This will take you inside your container. Then you can list out using 'ls' command.

Related