【问题标题】:How to use powershell to interact with docker container ("\r" command not found)如何使用powershell与docker容器交互(\"\\r\" command not found)
【发布时间】:2022-12-02 18:42:29
【问题描述】:

My OS is Windows. When creating a Docker container and interacting with it using Windows powershell:

docker create -i --name test_container debian
docker container start -i test_container

And running a command such as ls, then it gives the following error:

bash: line 2: $\'ls\\r\': command not found

I assume this is because newlines in windows (\\r\\n) are different than unix (\\n).

How can I use powershell interactively with Docker?

I\'ve searched online for a solution on this, but only get results on converting files, not working with powershell directly. I\'ve also looked through the settings of Docker to see if there\'s an option on this, but am unable to find anything to change this behavior. Running docker start --help does not provide any special options for usage with powershell.

I specifically want to use powershell as I dislike cmd and the shell provided by Docker (the up/down keys don\'t work as expected for example).

    标签: windows docker powershell containers debian


    【解决方案1】:
    【解决方案2】:
    猜你喜欢
    • 2023-02-18
    • 2019-07-07
    • 2020-09-26
    • 2019-06-06
    • 2021-06-17
    • 2019-07-01
    • 2015-09-29
    • 2021-06-28
    • 1970-01-01
    相关资源
    最近更新 更多