Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS EB Deploy shows missing Dockerrun.aws.json after deploying

I'm trying to deploy my application to Elastic Beanstalk (running docker) but during the deploy it always fails with something like this:

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

As far as I understand Dockerrun.aws.josn file is not required if Dockerfile is present and I don't see any reason why we should have it.

My Dockerfile is like this:

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"]

Our application source files are in the same directory as the Dockerfile. I took the example of file structure and the dockerfile it self from http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/docker-singlecontainer-deploy.html

We use the same Dockerfile to build the app using CodeBuild and it has no error. also locally I can build that app without any problems.

Any help would be greatly appreciated.

like image 721
Jānis Avatar asked Jan 30 '17 14:01

Jānis


1 Answers

As mentioned in the comment bellow the issue might be not in the missing Dockerrun.aws.json but in something else.

To pin point the actual issue I've had to ssh into the box and check the logs. In my case it was

eb ssh
less /var/log/eb-docker/containers/eb-current-app/unexpected-quit.log
like image 50
T.Chmelevskij Avatar answered Oct 25 '22 02:10

T.Chmelevskij