简体   繁体   English

Jenkins在Windows Server 2016中重启Docker失败

[英]Restart docker in windows server 2016 fails by Jenkins

I've configured CI/CD using Jenkins for .NET Framework. 我已经使用Jenkins for .NET Framework配置了CI / CD。 Jenkins is running on windows server 2016. When jenkins tried to restart the docker container using Execute Windows Batch Command then it threw an error. Jenkins在Windows Server 2016上运行。当jenkins尝试使用“ 执行Windows批处理命令”重新启动docker容器时,它抛出了错误。

docker: Error response from daemon: failed to create endpoint ***** on network nat: HNS failed with error : Unspecified error. docker:来自守护程序的错误响应:无法在网络nat上创建端点*****:HNS失败,错误:未指定错误。

How can I resolve this issue? 我该如何解决这个问题?

docker: Error response from daemon: failed to create endpoint ***** on network nat: HNS failed with error : Unspecified error.

This is very generic error on docker with windows. 这是带有Windows的docker上的非常普遍的错误。 I have faced similar error and spent few hours. 我遇到了类似的错误,花了几个小时。 but somehow windows is not giving you proper error messages. 但是以某种方式Windows无法给您正确的错误消息。

This error is related to port already in use because jobs with which you are trying to stop container is still occupied the name and port or may be some other service has already occupied this port. 此错误与端口已在使用中有关,因为您试图停止容器的作业仍在占用名称和端口,或者可能是某些其他服务已在占用此端口。 So you have to remove the older container first or start with different name/port. 因此,您必须先删除较旧的容器或以其他名称/端口开头。

just do 做就是了

docker stop <your-container-name>/<container-id>
docker rm -v <your-container-name>/<container-id>

Than try to spin new container. 比尝试旋转新的容器。 It will definitely start. 它一定会开始。

Hope this will help. 希望这会有所帮助。

Thank you! 谢谢!

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

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