Sometimes we need to use our own laptop to try something but sometimes due to system contraints we are blocked.
Here, we use below command to access the virtual filesystem on container on our office VMs-
$ docker exec -it <image name or id> /bin/bash
or
$ docker exec -it <image name or id> /bin/sh
But if try to use on Windows machine Command Prompt, we can't.
So we can try 'GitBash', but again it is not a complete Linux terminal also, so if try any of the
above commands we see below error-
Here, we use below command to access the virtual filesystem on container on our office VMs-
$ docker exec -it <image name or id> /bin/bash
or
$ docker exec -it <image name or id> /bin/sh
But if try to use on Windows machine Command Prompt, we can't.
So we can try 'GitBash', but again it is not a complete Linux terminal also, so if try any of the
above commands we see below error-
So you try winpty in place of bin/bash but that also doesn't work.
But interestingly we can execute other docker command like-
docker run
docker start
docker images etc..
But we want to get into the file system, so for that we need to use winpty like -
winpty docker exec -it <image id or name> sh
or
winpty docker exec -it <image id or name> bash
But the only difference I observed is that there will be different prompts & I currently know only
about these 2 options sh or bash
But again it is not complete Linux terminal so there will be limited Linux commands are
available to use.
But interestingly we can execute other docker command like-
docker run
docker start
docker images etc..
But we want to get into the file system, so for that we need to use winpty like -
winpty docker exec -it <image id or name> sh
or
winpty docker exec -it <image id or name> bash
But the only difference I observed is that there will be different prompts & I currently know only
about these 2 options sh or bash
But again it is not complete Linux terminal so there will be limited Linux commands are
available to use.