[英]Possible to create a script that enters/exits a docker container?
From this post I found out that I can detach from a docker container with the sequence Ctrl + p + Ctrl + q . 从这篇文章中,我发现可以按Ctrl + p + Ctrl + q的顺序从Docker容器中分离。
I was wondering, is it possible to create a single bash (or python, or whatever) script that enters a docker container, runs a few commands, then uses the escape sequence to exit the container? 我想知道,是否可以创建一个单独的bash(或python,或其他)脚本进入Docker容器,运行一些命令,然后使用转义序列退出该容器? I think it may not be possible, but please confirm/deny this!
我认为这不可能,但请确认/否认!
docker exec --detach
(或-d
)应该运行命令而无需附加。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.