简体   繁体   English

当我尝试启动tomcat服务器时,Docker在构建过程中挂起

[英]Docker hangs during build when I try to start a tomcat server

I'm using Windows containers and the microsoft/nanoserver as my base. 我使用Windows容器和microsoft / nanoserver作为基础。 I'm trying to start up a Tomcat server during the build, but when I do so the build hangs and all I can is cancel it. 我正在尝试在构建过程中启动Tomcat服务器,但是当我这样做时,构建会挂起,而我只能取消它。 Unfortunately I have to start the server so it will deploy a war file so that I can then stop the server and alter its configuration. 不幸的是,我必须启动服务器,以便它将部署war文件,以便随后我可以停止服务器并更改其配置。 I know I can just run the image, make my changes, and then commit but this seems like cheating. 我知道我可以运行图像,进行更改,然后提交,但这似乎是作弊。 The only thing I can think of is that the startup / catalina script is writing to stdout, but I've tried redirecting to null and it still hangs. 我唯一能想到的是startup / catalina脚本正在写入stdout,但是我尝试将其重定向为null,但仍然挂起。 Any ideas out there for me to try? 有什么想法让我尝试吗?

Dockerfile excerpt: Dockerfile摘录:

RUN powershell start-process -FilePath .\startup.bat -ArgumentList "/c" -NoNewWindow -RedirectStandardOutput Out-Null

It looks like you can't have a java process running on the image during the build; 看起来您在构建期间无法在映像上运行Java进程; I was able to fix this by using Start-Sleep to wait for about a minute and then kill any java process running on the machine. 我可以通过使用Start-Sleep等待大约一分钟,然后杀死计算机上运行的所有Java进程来解决此问题。 The build proceeded after that. 之后,构建继续进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM