'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 1:[1]

I experienced this issue when my deployment had a ".ebextensions" directory. Removing the directory solved the issue.

AWS Notes

On Amazon Linux 2 platforms, instead of providing files and commands in .ebextensions configuration files, we highly recommend that you use Buildfile. Procfile, and platform hooks whenever possible to configure and run custom code on your environment instances during instance provisioning. For details about these mechanisms, see Extending Elastic Beanstalk Linux platforms.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1