2015-05-06 35 views
3

我正在嘗試在Amazon EC2中部署Dockerfile和Dockerrun.aws.json。我能夠成功創建Docker容器,但在此之後,實例崩潰。我不知道爲什麼 Docker容器意外退出或如何來解決它。錯誤在Amazon EC2中的Docker部署 - Docker容器意外退出

登錄:

Step 36 : RUN service apache2 stop && service apache2 start 
     ---> Running in 1531cdba4bf1 
    Stopping web server: apache2. 
    [91m/usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted) 
    [0m[91mSetting ulimit failed. See README.Debian for more information. 
    [0m[91mAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.17.0.32. Set the 'ServerName' directive globally to suppress this message 
    [0mStarting web server: apache2. 

    ---> 86403887587f 
    Removing intermediate container 1531cdba4bf1 
    Step 37 : EXPOSE 80 
    ---> Running in 395114dad85b 
    ---> 7350f1436bc2 
    Removing intermediate container 395114dad85b 
    Successfully built 7350f1436bc2 
    Successfully built aws_beanstalk/staging-app 
    [2015-04-21T15:16:46.558Z] INFO [1799] - [CMD-Startup/StartupStage0/AppDeployPreHook/04run.sh] : Starting activity... 
    [2015-04-21T15:16:54.493Z] INFO [1799] - [CMD-Startup/StartupStage0/AppDeployPreHook/04run.sh] : Activity execution failed, because: command failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/pre/04run.sh 
    d84f98c9e97a7287ca461510866d32adec0da73cbe5a7abcb8201490332a0f48 
    Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Tue Apr 21 15:16:54 UTC 2015:. Check snapshot logs for details. (Executor::NonZeroExitStatus) 
     at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/executor-1.0/lib/executor/exec.rb:81:in `sh' 
     from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/executor-1.0/lib/executor.rb:15:in `sh' 
     from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/executable.rb:63:in `execute!' 
     from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/hook-directory-executor.rb:29:in `block (2 levels) in run!' 

從日誌中其他信息:

Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Tue Apr 21 15:16:54 UTC 2015:. Check snapshot logs for details. (Executor::NonZeroExitStatus) 
    at /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/executor-1.0/lib/executor/exec.rb:81:in `sh' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/executor-1.0/lib/executor.rb:15:in `sh' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/executable.rb:63:in `execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/hook-directory-executor.rb:29:in `block (2 levels) in run!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/hook-directory-executor.rb:28:in `block in run!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/hook-directory-executor.rb:26:in `each' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/hook-directory-executor.rb:26:in `run!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:215:in `block (3 levels) in exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:209:in `block (2 levels) in exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `each' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `each_with_index' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `block in exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:204:in `exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:158:in `execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:68:in `run' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:64:in `block (2 levels) in execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:62:in `block in execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:106:in `execute_command' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:60:in `execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/bin/command-processor:46:in `<top (required)>' 
    from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `load' 
    from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `<main>' 



[2015-04-21T15:16:54.494Z] INFO [1799] - [CMD-Startup/StartupStage0/AppDeployPreHook/04run.sh] : Activity failed. 
[2015-04-21T15:16:54.494Z] INFO [1799] - [CMD-Startup/StartupStage0/AppDeployPreHook] : Activity failed. 
[2015-04-21T15:16:54.494Z] INFO [1799] - [CMD-Startup/StartupStage0] : Activity failed. 
[2015-04-21T15:16:54.500Z] INFO [1799] - [CMD-Startup] : Completed activity. Result: 
    Command CMD-Startup(stage 0) failed. 
[2015-04-21T15:17:01.435Z] INFO [31657] - [CMD-TailLogs] : Starting activity... 
[2015-04-21T15:17:02.355Z] INFO [31657] - [CMD-TailLogs/AddonsBefore] : Starting activity... 
[2015-04-21T15:17:02.355Z] INFO [31657] - [CMD-TailLogs/AddonsBefore] : Completed activity. 
[2015-04-21T15:17:02.356Z] INFO [31657] - [CMD-TailLogs/TailLogsDockerPS] : Starting activity... 
[2015-04-21T15:17:02.356Z] INFO [31657] - [CMD-TailLogs/TailLogsDockerPS/DockerPS] : Starting activity... 
[2015-04-21T15:17:02.396Z] INFO [31657] - [CMD-TailLogs/TailLogsDockerPS/DockerPS] : Completed activity. 
[2015-04-21T15:17:02.396Z] INFO [31657] - [CMD-TailLogs/TailLogsDockerPS] : Completed activity. Result: 
    Command CMD-TailLogs stage 0 completed. 
[2015-04-21T15:17:02.396Z] INFO [31657] - [CMD-TailLogs/TailLogs] : Starting activity... 
[2015-04-21T15:17:02.396Z] INFO [31657] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity... 
[2015-04-21T15:17:02.858Z] INFO [31657] - [CMD-TailLogs/TailLogs/TailLogs] : Completed activity. 
[2015-04-21T15:17:02.858Z] INFO [31657] - [CMD-TailLogs/TailLogs] : Completed activity. Result: 
    Command CMD-TailLogs stage 1 completed. 
[2015-04-21T15:17:02.859Z] INFO [31657] - [CMD-TailLogs/AddonsAfter] : Starting activity... 
[2015-04-21T15:17:02.859Z] INFO [31657] - [CMD-TailLogs/AddonsAfter] : Completed activity. 
[2015-04-21T15:17:02.859Z] INFO [31657] - [CMD-TailLogs] : Completed activity. Result: 
    Command CMD-TailLogs succeeded. 
[2015-05-06T12:25:45.126Z] INFO [20429] - [CMD-TailLogs] : Starting activity... 
[2015-05-06T12:25:45.601Z] INFO [20429] - [CMD-TailLogs/AddonsBefore] : Starting activity... 
[2015-05-06T12:25:45.602Z] INFO [20429] - [CMD-TailLogs/AddonsBefore] : Completed activity. 
[2015-05-06T12:25:45.602Z] INFO [20429] - [CMD-TailLogs/TailLogsDockerPS] : Starting activity... 
[2015-05-06T12:25:45.602Z] INFO [20429] - [CMD-TailLogs/TailLogsDockerPS/DockerPS] : Starting activity... 
[2015-05-06T12:25:45.640Z] INFO [20429] - [CMD-TailLogs/TailLogsDockerPS/DockerPS] : Completed activity. 
[2015-05-06T12:25:45.640Z] INFO [20429] - [CMD-TailLogs/TailLogsDockerPS] : Completed activity. Result: 
    Command CMD-TailLogs stage 0 completed. 
[2015-05-06T12:25:45.641Z] INFO [20429] - [CMD-TailLogs/TailLogs] : Starting activity... 
[2015-05-06T12:25:45.641Z] INFO [20429] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity... 



------------------------------------- 
/var/log/docker-ps.log 
------------------------------------- 
'docker ps' ran at Wed May 6 12:25:45 UTC 2015: 
CONTAINER ID  IMAGE    COMMAND    CREATED    STATUS    PORTS    NAMES 



------------------------------------- 
/var/log/eb-commandprocessor.log 
------------------------------------- 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/hook-directory-executor.rb:26:in `run!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:215:in `block (3 levels) in exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:209:in `block (2 levels) in exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `each' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `each_with_index' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:207:in `block in exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:204:in `exec_stage' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:158:in `execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command.rb:68:in `run' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:64:in `block (2 levels) in execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `call' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:169:in `exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:126:in `timeout_exec' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:110:in `block in create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `instance_eval' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/activity.rb:109:in `create' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:62:in `block in execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:106:in `execute_command' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/lib/elasticbeanstalk/command-processor.rb:60:in `execute!' 
    from /opt/elasticbeanstalk/lib/ruby/lib/ruby/gems/2.1.0/gems/beanstalk-core-1.1/bin/command-processor:46:in `<top (required)>' 
    from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `load' 
    from /opt/elasticbeanstalk/lib/ruby/bin/command-processor:23:in `<main>' 



[2015-04-21T15:16:54.500Z] ERROR [1799] : Command CMD-Startup(stage 0) failed! 
[2015-04-21T15:16:54.503Z] INFO [1799] : Command processor returning results: 
{"status":"FAILURE","api_version":"1.0","truncated":"false","results":[{"status":"FAILURE","msg":"[CMD-Startup/StartupStage0/AppDeployPreHook/04run.sh] command failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/pre/04run.sh\nd84f98c9e97a7287ca461510866d32adec0da73cbe5a7abcb8201490332a0f48\nDocker container quit unexpectedly after launch: Docker container quit unexpectedly on Tue Apr 21 15:16:54 UTC 2015:. Check snapshot logs for details.","returncode":1,"events":[{"msg":"Successfully pulled chuseuiti/pynusci:latest","severity":"TRACE","timestamp":1429627195},{"msg":"Successfully built aws_beanstalk/staging-app","severity":"TRACE","timestamp":1429629406},{"msg":"Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Tue Apr 21 15:16:54 UTC 2015:. Check snapshot logs for details.","severity":"ERROR","timestamp":1429629414}]}]} 
[2015-04-21T15:17:01.431Z] DEBUG [31657] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties 
    [2015-04-21T15:17:01.431Z] DEBUG [31657] : Checking if the command processor should execute. 
[2015-04-21T15:17:01.435Z] DEBUG [31657] : Checking whether the command is applicable to instance (i-c3213b14).. 
[2015-04-21T15:17:01.435Z] INFO [31657] : Command is applicable to this instance (i-c3213b14).. 
[2015-04-21T15:17:01.435Z] DEBUG [31657] : Checking if the received command stage is valid.. 
[2015-04-21T15:17:01.435Z] INFO [31657] : No stage_num in command. Valid stage.. 
[2015-04-21T15:17:01.435Z] INFO [31657] : Command processor should execute command. 
[2015-04-21T15:17:01.435Z] DEBUG [31657] : Storing current stage.. 
[2015-04-21T15:17:01.435Z] DEBUG [31657] : Stage_num does not exist. Not saving null stage. Returning.. 
[2015-04-21T15:17:01.435Z] INFO [31657] : Executing command: CMD-TailLogs... 
[2015-04-21T15:17:01.436Z] DEBUG [31657] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties 
[2015-04-21T15:17:01.436Z] DEBUG [31657] : Refreshing metadata.. 
[2015-04-21T15:17:02.352Z] DEBUG [31657] : Refreshed environment metadata. 
[2015-04-21T15:17:02.352Z] DEBUG [31657] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands.. 
[2015-04-21T15:17:02.354Z] DEBUG [31657] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands.. 
[2015-04-21T15:17:02.355Z] INFO [31657] : Found enabled addons: []. 
[2015-04-21T15:17:02.355Z] DEBUG [31657] : Loaded definition of Command CMD-TailLogs. 
[2015-04-21T15:17:02.355Z] INFO [31657] : Executing command CMD-TailLogs activities... 
[2015-04-21T15:17:02.355Z] DEBUG [31657] : Setting environment variables.. 
[2015-04-21T15:17:02.355Z] INFO [31657] : Running AddonsBefore for command CMD-TailLogs... 
[2015-04-21T15:17:02.355Z] DEBUG [31657] : Running stages of Command CMD-TailLogs from stage 0 to stage 1... 
[2015-04-21T15:17:02.355Z] INFO [31657] : Running stage 0 of command CMD-TailLogs... 
[2015-04-21T15:17:02.356Z] DEBUG [31657] : Loaded 1 actions for stage 0. 
[2015-04-21T15:17:02.356Z] INFO [31657] : Running 1 of 1 actions: DockerPS... 
[2015-04-21T15:17:02.396Z] INFO [31657] : Running stage 1 of command CMD-TailLogs... 
[2015-04-21T15:17:02.396Z] DEBUG [31657] : Loaded 1 actions for stage 1. 
[2015-04-21T15:17:02.396Z] INFO [31657] : Running 1 of 1 actions: TailLogs... 
[2015-04-21T15:17:02.858Z] INFO [31657] : Running AddonsAfter for command CMD-TailLogs... 
[2015-04-21T15:17:02.859Z] INFO [31657] : Command CMD-TailLogs succeeded! 
[2015-04-21T15:17:02.860Z] INFO [31657] : Command processor returning results: 
{"status":"SUCCESS","api_version":"1.0","truncated":"false","results":[{"status":"SUCCESS","msg":"","returncode":0,"events":[{"msg":"[Instance: i-c3213b14] Successfully finished tailing 7 log(s)","severity":"INFO","timestamp":1429629422860}]}]} 
[2015-05-06T12:25:45.121Z] DEBUG [20429] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties 
    [2015-05-06T12:25:45.125Z] INFO [20429] : Command is applicable to this instance (i-c3213b14).. 
[2015-05-06T12:25:45.125Z] DEBUG [20429] : Checking if the received command stage is valid.. 
[2015-05-06T12:25:45.125Z] INFO [20429] : No stage_num in command. Valid stage.. 
[2015-05-06T12:25:45.125Z] INFO [20429] : Command processor should execute command. 
[2015-05-06T12:25:45.125Z] DEBUG [20429] : Storing current stage.. 
[2015-05-06T12:25:45.125Z] DEBUG [20429] : Stage_num does not exist. Not saving null stage. Returning.. 
[2015-05-06T12:25:45.126Z] INFO [20429] : Executing command: CMD-TailLogs... 
[2015-05-06T12:25:45.126Z] DEBUG [20429] : Reading config file: /etc/elasticbeanstalk/.aws-eb-stack.properties 
[2015-05-06T12:25:45.126Z] DEBUG [20429] : Refreshing metadata.. 
[2015-05-06T12:25:45.598Z] DEBUG [20429] : Refreshed environment metadata. 
[2015-05-06T12:25:45.599Z] DEBUG [20429] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_ContainerConfigFileContent||commands.. 
[2015-05-06T12:25:45.600Z] DEBUG [20429] : Retrieving metadata for key: AWS::ElasticBeanstalk::Ext||_API||_Commands.. 
[2015-05-06T12:25:45.601Z] INFO [20429] : Found enabled addons: []. 
[2015-05-06T12:25:45.601Z] DEBUG [20429] : Loaded definition of Command CMD-TailLogs. 
[2015-05-06T12:25:45.601Z] INFO [20429] : Executing command CMD-TailLogs activities... 
[2015-05-06T12:25:45.601Z] DEBUG [20429] : Setting environment variables.. 
[2015-05-06T12:25:45.601Z] INFO [20429] : Running AddonsBefore for command CMD-TailLogs... 
[2015-05-06T12:25:45.602Z] DEBUG [20429] : Running stages of Command CMD-TailLogs from stage 0 to stage 1... 
[2015-05-06T12:25:45.602Z] INFO [20429] : Running stage 0 of command CMD-TailLogs... 
[2015-05-06T12:25:45.602Z] DEBUG [20429] : Loaded 1 actions for stage 0. 
[2015-05-06T12:25:45.602Z] INFO [20429] : Running 1 of 1 actions: DockerPS... 
[2015-05-06T12:25:45.641Z] INFO [20429] : Running stage 1 of command CMD-TailLogs... 
[2015-05-06T12:25:45.641Z] DEBUG [20429] : Loaded 1 actions for stage 1. 
[2015-05-06T12:25:45.641Z] INFO [20429] : Running 1 of 1 actions: TailLogs... 

我Dockerrun.aws.json如下:

{ 

    "AWSEBDockerrunVersion": "1", 
    "Ports": [ 
     { 
      "ContainerPort":"80" 
     } 
    ], 
    "Volumes":{ 

    } 
} 
+0

燦您使用'eb logs'並檢查/var/log/directory-hooks-executor.log以查看有關錯誤的更多信息? – Michael

+0

下載日誌後,我沒有找到directory-hooks-executor.log。我找到了以下日誌文​​件:cfn-hup.log,cfn-init.log,cnf-init-cmd.log,cloud-init.log,cloud-init-output.log,docker-events.log,eb-activity .log,eb-cfn-init.log,eb-cfn-init-call.log,eb-commadprocessor.log,eb-publish-logs.log,eb-tools.log,eb-versión-deployment.log和unexpected -quit.log。此外,我還在問題中更新了日誌的更多行,以防情況有所幫助。 – chuseuiti

+0

從你的日誌,它看起來像你的碼頭集裝箱正在退出,當你的Apache建立它有問題,你可以手動啓動這個容器?當你以交互方式啓動它並嘗試啓動Apache時會發生什麼? – Michael

回答

6

答案是什麼錯誤

之後的評論,這個問題似乎是與Apache和ulimit錯誤有關。因爲即使通常該錯誤/警告不會影響apache服務器的運行,它也會在創建容器時返回Amazon錯誤,並且Docker容器似乎因此而退出。(我修復了與該錯誤/警告相關的錯誤/警告服務器名稱)

如何:

從米歇爾的有關容器中,前臺進程的意見,我說此行我Dockerfile:

CMD /etc/init.d/apache2 start -D FOREGROUND 

阿帕奇問題:

ServerName中很容易通過向固定的.conf:

ServerName localhost 

和問題,用ulimit:

一個跟進的ulimit問題:

Dockerfile privileged flag for Docker container (Needed because of Apache error ulimit) AWS