简体   繁体   English

启动超过90天的Docker容器

[英]Starting docker container that is more than 90 days old

I had created a docker container image for Business Central 2 months ago. 2个月前,我为Business Central创建了一个Docker容器映像。 Now when I try to start the container it starts with an unhealthy status and Business Central client doesn't work. 现在,当我尝试启动容器时,它以不正常的状态开始,并且Business Central客户端不起作用。

docker start <container-id>

在此处输入图片说明

I checked the logs that told me that I am trying to run a container which is more than 90 days old. 我检查了告诉我我正在尝试运行超过90天的容器的日志。

Initializing... 初始化中...
Restarting Container 重新启动容器
PublicDnsName unchanged PublicDnsName不变
Hostname is MyBCDev 主机名是MyBCDev
PublicDnsName is MyBCDev PublicDnsName是MyBCDev
You are trying to run a container which is more than 90 days old. 您正在尝试运行超过90天的容器。
Microsoft recommends that you always run the latest version of our containers. Microsoft建议您始终运行最新版本的容器。
Set the environment variable ACCEPT_OUTDATED to 'Y' if you want to run this container anyway. 如果仍要运行此容器,请将环境变量ACCEPT_OUTDATED设置为“ Y”。
at , C:\\Run\\navstart.ps1: line 54 在,C:\\ Run \\ navstart.ps1:第54行
at , C:\\Run\\start.ps1: line 121 在,C:\\ Run \\ start.ps1:第121行
at , : line 1 在:第1行

I googled the issue and all I can find is to use the docker run command with accept outdated parameter, but that creates a new container. 我用谷歌搜索了这个问题,我所能找到的就是将docker run命令与accept过时的参数一起使用,但这会创建一个新的容器。 Whereas I want to start the existing container. 而我想启动现有的容器。

docker run --env accept_eula=Y --memory 4G microsoft/dynamics-nav

How can I start an existing docker container that is more than 90 days old? 如何启动已存在90天以上的现有Docker容器?

Update 更新资料

I did the docker commit using the existing container and repository:tag. 我使用现有的容器和repository:tag进行了docker commit。 But when I ran the container (docker run) using the new image it got stuck somewhere in the middle 但是当我使用新映像运行容器(docker运行)时,它卡在了中间位置

在此处输入图片说明

Try to set ACCEPT_OUTDATED=Y and start the container. 尝试设置ACCEPT_OUTDATED=Y并启动容器。 If it doesn't worked then try this hack. 如果不起作用,请尝试使用此技巧。

Make use of docker commit command. 利用docker commit命令。

docker commit container-id myimage:v1

This will create new docker image out of that stopped container with all the data and config in it. 这将从停止的容器中创建所有数据和配置的新docker映像。

Run a new docker container out of that image. 从该映像中运行一个新的Docker容器。

This new docker container will be almost same as that of stopped docker container that was 90 days old. 这个新的docker容器将与90天前停止的docker容器几乎相同。

Hope this helps. 希望这可以帮助。

您应该设置ACCEPT_OUTDATED=Y

docker run -e ACCEPT_EULA=Y -e ACCEPT_OUTDATED=Y --memory 4G microsoft/dynamics-nav

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

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