Search code examples
amazon-web-servicesdockeramazon-elastic-beanstalk

Deploy docker container fails on AWS Beanstalk


I have a simple application (docker) that I want to deploy through the AWS beanstalk. U have a zip arhive with 2 files:

+simple.jar
+Dockerfile

Dockerfile contains these records:

FROM openjdk:11
WORKDIR /usr/app
COPY ./ ./
EXPOSE 80
CMD ["java", "-jar", "simple.jar"]

I am getting this error during dpeloyment

[ERROR] An error occurred during execution of command [app-deploy] - [Run Docker Container]. Stop running the command. Error: open file failed with error open /opt/elasticbeanstalk/deployment/.aws_beanstalk.current-container-id: no such file or directory 

local build through "docker build" works and application is available on the port 80.

So I am not sure what to do and how to debug the problem more deeply.


Solution

  • So problem was solved by changing the Platform branch from "Docker running on 64but Amazon Linux 2" to "Docker running on 64but Amazon Linux".

    It has different versions, but actually why it is not running needs more deep investigation.