5

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
  • 3
    1. Use -it, 2. Don't use ISE, try from normal powershell prompt Commented Jan 2, 2019 at 1:11
  • 1
    @GregorySuvalian: using normal powershell did the trick. Please add this as answer and i will accept it. Commented Jan 2, 2019 at 1:19

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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.

2 Comments

This answer refers to linux, the OP was Windows
It also works on windows poweshell @LukeBriner

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.