泊坞窗错误 - " JQ:错误:无法遍历空" [英] Docker Error - "jq: error: Cannot iterate over null"

查看:1373
本文介绍了泊坞窗错误 - " JQ:错误:无法遍历空"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我想部署弹性魔豆一dockerfile,但我不能让过去的这个错误 - JQ:错误:无法遍历空。

So I'm trying to deploy a dockerfile on Elastic Beanstalk, but I can't get past this error - "jq: error: Cannot iterate over null".

Successfully built [myContainerId]
Successfully built aws_beanstalk/staging-app
[2015-01-29T10:35:59.494Z] INFO  [16343] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/04run.sh] : Starting activity...
[2015-01-29T10:36:05.507Z] INFO  [16343] - [CMD-AppDeploy/AppDeployStage0/AppDeployPreHook/04run.sh] : Activity execution failed, because: command failed with error code 1: /opt/elasticbeanstalk/hooks/appdeploy/pre/04run.sh
jq: error: Cannot iterate over null
Docker container quit unexpectedly after launch: Docker container quit unexpectedly on Thu Jan 29 10:36:05 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'

有未在日志中的任何其他错误。我多克容器成功构建,因此它似乎不太可能的错误是从那里来。

There aren't any other errors in the logs. My Docker container is successfully built, so it seems unlikely the error is coming from there.

我的Dockerrun.aws.json是这样的:

My Dockerrun.aws.json looks like :

   {
  "AWSEBDockerrunVersion": "1",
  "Image": {
    "Name": "blah",
    "Update": "false"
  },
  "Ports": [
    {
      "ContainerPort": "8080"
    }
  ]
}

我撞我的头撞墙用这个,我什么改变似乎影响它,谷歌搜索一直没有任何帮助。

I'm banging my head against a wall with this one, nothing I change seems to affect it and googling hasn't been of any help.

任何想法?

推荐答案

现在的问题是,你的Dockerrun.aws.json文件丢失属性。

The problem is that your Dockerrun.aws.json file is missing the Volumes property.

04 pre.sh脚本,以便查询JSON文件使用 JQ 工具。

The 04pre.sh script uses the jq tool in order to query the JSON file.

具体而言,它运行在您的文件下面的命令,这将产生一个错误:

Specifically, it runs the following command on your file, which yields to an error:

$ jq -c '.Volumes[] | [.HostDirectory, .ContainerDirectory]' < Dockerrun.aws.json
jq: error: Cannot iterate over null

指定一个空的卷阵列应该可以解决的错误。

Specifying an empty "Volumes" array should resolve the error.

这篇关于泊坞窗错误 - &QUOT; JQ:错误:无法遍历空&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆