我想打开一个交互式 shell,该 shell 使用绑定挂载的仓库上的 bitbake 环境并运行脚本。
问题在于
我还尝试了以下内容:
docker run --rm -it \
--mount type=bind,source=$(MY_PATH),destination=/mnt/bb_repoistory \
my_image /bin/bash -c "cd /mnt/bb_repoistory/oe-core && source build/conf/set_bb_env.sh"
问题在于
-it
参数似乎没有任何作用,因为在执行cd /mnt/bb_repoistory/oe-core && source build/conf/set_bb_env.sh
后,shell立即退出。我还尝试了以下内容:
docker run --rm -it \
--mount type=bind,source=$(MY_PATH),destination=/mnt/bb_repoistory \
my_image /bin/bash -c "cd /mnt/bb_repoistory/oe-core && source build/conf/set_bb_env.sh && bash"
这会生成一个交互式shell,但是set_bb_env.sh定义的宏都没有被执行。
有没有一种方法可以正确地启动脚本并提供tty?
man bash
命令,特别是关于bash的-i
选项和INVOCATION部分的文档吗?你调用bash的方式不是交互式的。 - Robin479/bin/bash -ci
,但没有成功。添加-c
标志的行为似乎总是在执行'''
之间的参数后退出shell,而不管其他选项是否添加。 - Arthur Pinheiro