2016-11-14 40 views
0

我正在嘗試使用容器來部署基於Fortran的代碼。我已經成功爲Fortran環境創建了一個映像存儲庫。但是,當我嘗試使用容器時,容器無法啓動。它保持建築,超時後永不停止。Bluemix容器關閉問題

我檢查了在線解決方案,有人建議這是由於尺寸問題。不過,我甚至試圖分配2 GB的內存(在我的情況下最大允許),但我仍然無法獲得容器的工作。

有人可以提出一個解決方案嗎?

The result for cf ic inspect 

[ 
    { 
     "BluemixApp": null, 
     "BluemixServices": null, 
     "Config": { 
      "AttachStderr": false, 
      "AttachStdin": false, 
      "AttachStdout": false, 
      "Cmd": [], 
      "Dns": "", 
      "Env": [ 
       "logging_password=", 
       "space_id=09b438a1-16ea-4e78-9229-6c8ff48522bd", 
       "logstash_target=logmet.opvis.bluemix.net:9091", 
       "metrics_target=logmet.opvis.bluemix.net:9095" 
      ], 
      "Hostname": "instance-01024a2b", 
      "Image": "registry.ng.bluemix.net/legacycontainer/madeline-chat:latest", 
      "ImageArchitecture": "amd64", 
      "Labels": { 
       "doc.url": "/docs/images/docker_image_ibmnode/ibmnode_starter.html" 
      }, 
      "Memory": 1024, 
      "MemorySwap": "", 
      "OpenStdin": true, 
      "PortSpecs": "", 
      "StdinOnce": false, 
      "Tty": true, 
      "User": "", 
      "VCPU": 1, 
      "VolumesFrom": "", 
      "WorkingDir": "" 
     }, 
     "ContainerState": "Networking", 
     "Created": "2016-11-15T05:15:14.000000000Z", 
     "Group": {}, 
     "HostConfig": { 
      "Binds": [], 
      "CapAdd": [], 
      "CapDrop": [], 
      "ContainerIDFile": "", 
      "Links": [], 
      "LogConfig": { 
       "Config": {}, 
       "Type": "json-file" 
      }, 
      "LxcConf": [], 
      "PortBindings": { 
       "80/tcp": [ 
        { 
         "HostPort": "80" 
        } 
       ] 
      }, 
      "Privileged": false, 
      "PublishAllPorts": false 
     }, 
     "HostId": "", 
     "Human_id": "fortcontainer", 
     "Id": "5c3e7369-15f2-4c4c-a032-c7eaafe51057", 
     "Image": "sha256:64b79347416c1909ecaf24276c2b37a093c017f03986bd928ce7af29f6e4362e", 
     "Mounts": [], 
     "Name": "fortcontainer", 
     "NetworkSettings": { 
      "Bridge": "", 
      "Gateway": "", 
      "IPAddress": "172.31.0.14", 
      "IPPrefixLen": 0, 
      "MacAddress": "fa:16:3e:c3:62:6d", 
      "Networks": { 
       "default": { 
        "Aliases": null, 
        "EndpointID": "5c3e7369-15f2-4c4c-a032-c7eaafe51057", 
        "Gateway": "172.31.0.1", 
        "GlobalIPv6Address": "", 
        "GlobalIPv6PrefixLen": 0, 
        "IPAMConfig": null, 
        "IPAddress": "172.31.0.14", 
        "IPPrefixLen": 16, 
        "IPv6Gateway": "", 
        "Links": null, 
        "MacAddress": "fa:16:3e:c3:62:6d", 
        "NetworkID": "01f0a8a5-782c-40c3-a9c9-6fb1f2b338ab" 
       } 
      }, 
      "PortMapping": null, 
      "Ports": { 
       "80/tcp": [ 
        { 
         "HostIp": "169.44.117.254", 
         "HostPort": "80" 
        } 
       ] 
      }, 
      "PublicIpAddress": "169.44.117.254" 
     }, 
     "Path": "date", 
     "ResolvConfPath": "/etc/resolv.conf", 
     "State": { 
      "Error": "Unable to start container", 
      "ExitCode": -1, 
      "Fault": { 
       "code": 500, 
       "created": "2016-11-15T05:16:17Z", 
       "message": "Exceeded maximum number of retries. Exceeded max scheduling attempts 3 for instance 5c3e7369-15f2-4c4c-a032-c7eaafe51057. Last exception: [u'Traceback (most recent call last):\\n', u' File \"/opt/bbc/openstack-12.1.90/nova/local/lib/python2.7/site-packages" 
      }, 
      "FinishedAt": "2016-11-15T05:16:17.000000000Z", 
      "Ghost": "", 
      "Pid": 1, 
      "Running": false, 
      "StartedAt": "2016-11-15T05:15:14.000000000Z", 
      "Status": "Networking" 
     }, 
     "Volumes": {}, 
     "VolumesRW": {} 
    } 
] 

回答

1

你應該能夠獲得有關容器一些額外的信息,無論是通過cf ic logs(如果容器運行,只是不會主動),或cf ic inspect(如果容器沒有得到足夠遠爲。其中任何一個顯示關於可能發生的事情的更多信息?

+0

我已經添加了cf ic inspect的輸出,可以這樣做,因爲我只是想運行一個Hello World fortran可執行文件(使用madeline-聊天例如作爲參考)和圖像可能正在執行它,然後容器不會做任何事情 – Sid411

+0

@N Fritze我得到了問題當我上傳它時,我的dockerfile包含comman d執行fortran exe。所以它正在執行fortran exe並停止。我想我將不得不創建一個網頁,將與fortran exe交互並保持活力。感謝您的答覆。 – Sid411

+2

這很有道理。如果fortran程序正在完成並退出,那麼容器也應該退出。放入Fortran程序並返回(但保持接受未來請求並繼續執行)的Web服務器似乎是一個很好的設計來處理它。希望這一切順利! –