很熟悉的情况,又是莫名其妙好好的东西突然自己坏了,以前都好好的,最近突然冒出这个问题,在dockers容器外面输命令,容器就会报这个错,从stackoverflow上找到了解决办法
以前用的命令是
docker exec -it container ls
改用这个命令
docker exec -it container /bin/sh -c 'ls'
-it 去了也行,主要是/bin/bash 后面-c接命令
原因如下:
英文原文回答:
cd
is a special built-in utility, in the language of the POSIX shell specification. It's something that changes the behavior of the running shell and not a standalone program. The error message mean