[英]Exec into a docker restarting container
I have a docker container which was working well at one point.我有一个 docker 容器,它一度运行良好。 I have changed some files inside this container and now it wont stop restarting due to the changes I made.
我已经更改了此容器中的一些文件,现在由于我所做的更改,它不会停止重新启动。 I would like to enter this container but I keep getting this error:
我想进入这个容器,但我不断收到这个错误:
Error response from daemon: Container c571b334990f0f2b3fc61f5f922b9a5eacf5347fb8720d004d22c80d8569fceb is restarting, wait until the container is running
Is there anything I can do to enter this container and fix the changes I made?我能做些什么来进入这个容器并修复我所做的更改吗? Is there a feature/option where I start the container and enter it before it runs any entry script or does something?
是否有一个功能/选项可以让我在运行任何输入脚本或执行某些操作之前启动容器并输入它?
Thanks for the help.谢谢您的帮助。
The errors in the logs:日志中的错误:
goroutine 1 [running]:
jfrog.com/xray/pkg/utils/crypt.EncryptDecryptConnString(0x0, 0x0, 0x0, 0x0, 0x5d0, 0x5d, 0xc002fbb650)
/go/src/jfrog.com/xray/pkg/utils/crypt/encrypt_util.go:37 +0x263
jfrog.com/xray/internal/dbaccess.OpenConnection()
/go/src/jfrog.com/xray/internal/dbaccess/sql_layer.go:25 +0x65
jfrog.com/xray/internal/dbaccess.Connect()
/go/src/jfrog.com/xray/internal/dbaccess/dbutil.go:10 +0x22
jfrog.com/xray/internal/startup.InitXrayServer()
/go/src/jfrog.com/xray/internal/startup/start_xray_server.go:93 +0x4ef
main.main()
/go/src/jfrog.com/xray/cmd/server/server.go:9 +0x20
Serverxray-server service container is starting...
Exec: /opt/jfrog/xray-server/server
panic: runtime error: index out of range [1] with length 1
goroutine 1 [running]:
jfrog.com/xray/pkg/utils/crypt.EncryptDecryptConnString(0x0, 0x0, 0x0, 0x0, 0x5d0, 0x5d, 0xc002f8f4d0)
/go/src/jfrog.com/xray/pkg/utils/crypt/encrypt_util.go:37 +0x263
jfrog.com/xray/internal/dbaccess.OpenConnection()
/go/src/jfrog.com/xray/internal/dbaccess/sql_layer.go:25 +0x65
jfrog.com/xray/internal/dbaccess.Connect()
/go/src/jfrog.com/xray/internal/dbaccess/dbutil.go:10 +0x22
jfrog.com/xray/internal/startup.InitXrayServer()
/go/src/jfrog.com/xray/internal/startup/start_xray_server.go:93 +0x4ef
main.main()
/go/src/jfrog.com/xray/cmd/server/server.go:9 +0x20
Best way to handle situations like this is to override the entrypoint, by mounting it on the host.处理此类情况的最佳方法是通过将入口点安装在主机上来覆盖入口点。 Find the entrypoint, and add a delay in the entrypoint so it gives you enough time to clean-up.
找到入口点,并在入口点中添加延迟,以便您有足够的时间进行清理。 The logs appears to be of jfrog xray and the entrypoint for this is
/opt/jfrog/xray/app/bin/wrapper.sh
(if the version of xray is 3.x)日志似乎是 jfrog xray,入口点是
/opt/jfrog/xray/app/bin/wrapper.sh
(如果 xray 的版本是 3.x)
Also be aware, if the changes you have done are persisted, the changes are actually on the volumes or mount-point.另请注意,如果您所做的更改被保留,这些更改实际上是在卷或挂载点上。 So you do not need container to start to undo the changes.
因此,您不需要容器开始撤消更改。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.