CodexBloom - Programming Q&A Platform

Trouble with AWS CodeDeploy not recognizing my Docker image push to ECR

πŸ‘€ Views: 99 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-03
AWS CodeDeploy Docker ECR DevOps yaml

Quick question that's been bugging me - I'm collaborating on a project where Quick question that's been bugging me - After trying multiple solutions online, I still can't figure this out... I'm currently working with an scenario where AWS CodeDeploy doesn't seem to recognize the Docker image that I've pushed to Amazon ECR. I've set up my appspec.yml file, but the deployment fails with the following behavior: `behavior: No files found for deployment`. I've confirmed that my Docker images are being pushed correctly to ECR, and I can see them in the repository. Here’s the relevant snippet of my appspec.yml: ```yaml version: 0.0 os: linux files: - source: /docker-compose.yml destination: /app/ hooks: AfterInstall: - location: scripts/start_server.sh timeout: 300 runas: root ``` In my buildspec.yml, I have the following code to push the Docker image: ```yaml version: 0.2 phases: build: commands: - $(aws ecr get-login --no-include-email --region us-west-2) - docker build -t myapp:latest . - docker tag myapp:latest <account_id>.dkr.ecr.us-west-2.amazonaws.com/myapp:latest - docker push <account_id>.dkr.ecr.us-west-2.amazonaws.com/myapp:latest ``` I’m using the following versions: - AWS CodeDeploy agent: 1.2.0 - Docker: 20.10.7 - ECR: No specific version, but I’m using the latest features. I've tried running the deployment multiple times, and each time I double-check that the image exists in ECR. I also ensured my IAM roles have the necessary permissions to access ECR and CodeDeploy. Any insights into why CodeDeploy might not be finding my Docker image? Is there a specific format or additional configuration I need to add to the appspec.yml or buildspec.yml for this to work correctly? I'm working on a API that needs to handle this. Any ideas what could be causing this? I'm developing on Ubuntu 20.04 with Yaml. Any suggestions would be helpful. What are your experiences with this? I'm coming from a different tech stack and learning Yaml. Could this be a known issue?