'Why is elasticbeanstalk apparently trying to rebuild my docker image on instance creation?
I have a Docker application which runs fine locally, and have done eb init and I'm able to run it successfully with eb local run.
Now I would like to deploy this app to a fresh new Elastic Beanstalk environment.
I understand I would need to use eb create myapp to create an environment, which would then be followed by eb deploy.
The environment creation fails and when I look at the logs, I see stuff like this:
2022/04/02 22:45:01.221361 [INFO] COPY failed: file not found in build context or excluded by .dockerignore: stat xxx.jar: file does not exist
This copy command is in my Dockerfile. Why is EB apparently trying to rebuild the image? And why is it trying this on environment creation?
What's the correct sequence of commands to create an environment and deploy my local image (which runs fine with eb local run)?
I've looked through the reams of documentation on the topic, but I feel like I'm so close and just need a specific one or two CLI commands.
Solution 1:[1]
eb create and eb deploy appear to be broken.
I was able to successfully deploy by creating a zip file containing the Dockerfile and all local dependencies, and then manually uploading the zip to the Elastic Beanstalk environment previously created by eb create (initially in a broken state).
Elastic Beanstalk automatically builds and runs the docker image.
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 | Alex R |
