Jān*_*nis 11 amazon-web-services docker amazon-elastic-beanstalk
我正在尝试将我的应用程序部署到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
Run Code Online (Sandbox Code Playgroud)
据我所知,如果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"]
Run Code Online (Sandbox Code Playgroud)
我们的应用程序源文件与Dockerfile位于同一目录中.我从http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html获取了文件结构和dockerfile的示例.
我们使用相同的Dockerfile使用CodeBuild构建应用程序,它没有错误.也在本地我可以毫无问题地构建该应用程序.
任何帮助将不胜感激.
正如下面的评论中提到的,问题可能不在缺失中Dockerrun.aws.json,而在于其他。
为了查明实际问题,我必须通过 ssh 进入盒子并检查日志。就我而言是
eb ssh
less /var/log/eb-docker/containers/eb-current-app/unexpected-quit.log
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1774 次 |
| 最近记录: |