写入dockerrun.aws.json v2文件时出错 [英] Error writing dockerrun.aws.json v2 file

查看:120
本文介绍了写入dockerrun.aws.json v2文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用此文件在AWS中部署多容器nginx php-fpm应用程序.

I am using this file to deploy a multicontainer nginx php-fpm application in AWS.

我运行eb local run并显示此错误.

I run eb local run and shows me this error.

holdbusinessnginx_1 | nginx:在/etc/nginx/conf.d/upstream.conf:1的上游"php:9000"中找不到[emerg]主机 elasticbeanstalk_holdbusinessnginx_1退出,代码为1

holdbusinessnginx_1 | nginx: [emerg] host not found in upstream "php:9000" in /etc/nginx/conf.d/upstream.conf:1 elasticbeanstalk_holdbusinessnginx_1 exited with code 1

可能是因为nginx在php-fpm之前运行.

It probably is because nginx is running before php-fpm.

在docker-compose.yml文件中,有一个名为depends-on的指令.

In docker-compose.yml file there is a directive called depends-on.

是否可以在dockerrun.aws.json文件中使用它?

Is there a way to use it in dockerrun.aws.json file?

推荐答案

只需使用

  "links": [
    "php"
  ],

其中,php将是您在同一Dockerrun.aws.json文件中定义的其他容器的名称. EB有点在猜测对链接,卷等的依赖性.因此,通过强制nginx容器链接到php,您对EB说php应该在nignx之前启动.在快捷方式中. :-)

where php will be the name of other container you defined in the same Dockerrun.aws.json file. EB is kinda guessing the dependencies on the links, volumes etc. So with forcing nginx container to link to php you're saying to the EB that php should get up before nignx. In shortcut. :-)

这篇关于写入dockerrun.aws.json v2文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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