我只是使用docker start mysql -a
重新启动docker容器,并且该容器日志在我的终端屏幕上打印。
输出所有日志后,即使使用ctrl + C
,也无法退出该命令。那么有什么方法可以退出该命令?
Check the screenshot here.
最佳答案
您正在使用docker start out-mysql -a
以附加模式启动容器。
在docker docs中,如果您看到-a options的作用是,它将显示以下内容:
Options:
-a, --attach Attach STDOUT/STDERR and forward signals
因此,使用Ctrl+C
不会停止容器。解
Open a new terminal tab/window and type the following command to stop the container.
docker stop out-mysql
关于docker - 如何从命令 “docker start mysql -a”退出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63517628/