AWS EB Deploy在部署后显示缺少Dockerrun.aws.json

时间:2017-01-30 14:07:24

标签: amazon-web-services docker 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

据我所知,如果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位于同一目录中。 我从http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html

中获取了文件结构和dockerfile的示例

我们使用相同的Dockerfile使用CodeBuild构建应用程序,它没有错误。在本地我也可以毫无问题地构建该应用程序。

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

如下面的评论中所述,问题可能不在丢失的protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); var graphics = e.Graphics; var clientRectangle = ClientRectangle; var font = Font; var text = Text; var textSize = TextRenderer.MeasureText(text, font); var textBounds = DrawingHelper.AlignInRectangle(clientRectangle, textSize, ContentAlignment.MiddleLeft); graphics.FillRectangle(new SolidBrush(SystemColors.Control), ClientRectangle); ControlPaint.DrawBorder(graphics, clientRectangle, SystemColors.ControlDark, ButtonBorderStyle.Solid); TextRenderer.DrawText(graphics, text, font, textBounds, SystemColors.WindowText); } protected override void OnEnabledChanged(EventArgs e) { base.OnEnabledChanged(e); SetStyle(); } public void SetStyle() { if (DesignMode) return; SetStyle(ControlStyles.UserPaint, !Enabled); Invalidate(); } public static class DrawingHelper { public static Rectangle AlignInRectangle(Rectangle outer, Size inner, ContentAlignment alignment) { int x = 0; int y = 0; switch (alignment) { case ContentAlignment.BottomLeft: case ContentAlignment.MiddleLeft: case ContentAlignment.TopLeft: x = outer.X; break; case ContentAlignment.BottomCenter: case ContentAlignment.MiddleCenter: case ContentAlignment.TopCenter: x = Math.Max(outer.X + ((outer.Width - inner.Width) / 2), outer.Left); break; case ContentAlignment.BottomRight: case ContentAlignment.MiddleRight: case ContentAlignment.TopRight: x = outer.Right - inner.Width; break; } switch (alignment) { case ContentAlignment.TopCenter: case ContentAlignment.TopLeft: case ContentAlignment.TopRight: y = outer.Y; break; case ContentAlignment.MiddleCenter: case ContentAlignment.MiddleLeft: case ContentAlignment.MiddleRight: y = outer.Y + (outer.Height - inner.Height) / 2; break; case ContentAlignment.BottomCenter: case ContentAlignment.BottomRight: case ContentAlignment.BottomLeft: y = outer.Bottom - inner.Height; break; } return new Rectangle(x, y, Math.Min(inner.Width, outer.Width), Math.Min(inner.Height, outer.Height)); } } 中,而是在其他地方。

要指出实际的问题,我必须将ssh放入框中并检查日志。就我而言

Dockerrun.aws.json