- Le plus récent
- Le plus de votes
- La plupart des commentaires
I believe the problem is that when deploying to EB, docker-compose.yml is executed and docker build is executed again.
The server directory is not included in the file sent to EB by artifacts, so if we try to build again on the EB instance side, it will fail because there is no file.
The solution is to change the image referenced in docker-compose.yml to the ECR image, as described in Part 1 of the article you referred to.
https://bentranz.medium.com/deploy-dockerized-application-to-aws-elastic-beanstalk-f8a3cf2944a7
I updated the question to reflect new docker-compose.yml file. However, the issue still prevails, even when the image fetch comes from ECR (both manually and programmatically set)
Hi
Try in this way, The issue is Codebuild unable to find the DockerFile
docker build -f $CODEBUILD_SRC_DIR/server/backend.Dockerfile -t $IMAGE_REPOSITORY:$IMAGE_TAG .
So the issue was solved. The solution was simple.
The issue as pointed by shibata is that it didn't have access not only to backend.Dockerfile but to the entire directory /server/. I fixed it by including within buildspec.yml
artifacts:
files:
- docker-compose.yml
- nginx.conf
- "**/*"
This resolved the issue and Deploy stage was success!
Contenus pertinents
- demandé il y a un an
- Réponse acceptéedemandé il y a 7 jours
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a 3 ans
Can you tell me the structure of your repository? I suspect a problem with the folder structure and file locations.
I just updated the question with a screenshot that shows the folder structure
Can you try adding -w with server directory like this
I updated the buildspec.yml file to reflect the attempt. Unfortunately, the same error persists.
Instead of [docker build -w ...] which I gathered is an unsupported flag, I switched directories during the Build Stage and tried to replicate the effort.