我正在尝试将我的应用程序部署到 Elastic Beanstalk(运行 docker),但在部署过程中它总是失败
,如下所示:Activity execution failed, because: cat: /var/app/current/Dockerrun.aws.json: No such file or directory cat: /var/app/current/Dockerrun.aws.json: No such file or directory 2ba4cc7f9cb0a66db0ab1be8736ba96bffbb1c96a219cf5e888f99a964ae4f2a
据我了解,如果存在Dockerfile,则不需要Dockerrun.aws.josn文件,并且我看不出我们应该拥有它的任何理由。
我的 Dockerfile 是这样的:
FROM ubuntu:16.04
# create source directory
RUN rm -rf /var/www
RUN mkdir /var/www
# update and upgrade ubuntu
RUN apt-get update && apt-get upgrade -y
# install nginx
RUN apt-get install -y nginx
# install php 7
RUN apt-get install -y php7.0 php7.0-fpm php7.0-xml php7.0-curl
# install php mysql
RUN apt-get install -y php7.0-mysql
# install php mbstring
RUN apt-get install -y php7.0-mbstring
# install php mcrypt
RUN apt-get install -y php7.0-mcrypt
# install git
RUN apt-get install -y git
# install zip and unzip
RUN apt-get install -y zip unzip
ADD . /var/www
EXPOSE 80
CMD ["/usr/sbin/nginx", "-c", "/etc/nginx/nginx.conf"]
我们的应用程序源文件与 Dockerfile 位于同一目录中。我以文件结构和 dockerfile 为例,它自己来自 http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html
我们使用相同的 Dockerfile 来使用 CodeBuild 构建应用程序,它没有错误。 同样在本地,我可以毫无问题地构建该应用程序。
任何帮助将不胜感激。
正如下面的评论中所述,问题可能不在于丢失的Dockerrun.aws.json
,而在于其他方面。
为了查明实际问题,我不得不在框中ssh并检查日志。就我而言,它是
eb ssh
less /var/log/eb-docker/containers/eb-current-app/unexpected-quit.log