I have failed deploy, so I watched logs, and I realized that it using old code.
to make sure, I made new Beanstalk Environtment
,and it is working good.
So I checked my beanstalk logs, and
there are something weird.
It seems like failing to remove old images.
[INFO] Error response from daemon: conflict: unable to delete 127a3e1be9bf (cannot be forced)
How can I use new Image?
Dockerrun.aws.json
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "528729501303.dkr.ecr.ap-northeast-2.amazonaws.com/roa-advertiser:latest",
"Update": "true"
},
"Ports": [
{
"ContainerPort": 3000,
"HostPort": 80
}
]
}
eb-engine.log
2023/07/05 04:24:15.190283 [INFO] docker container 6d7718357199 is running aws_beanstalk/current-app
2023/07/05 04:24:15.190297 [INFO] Cleanup images ...
2023/07/05 04:24:15.190310 [INFO] Running command /bin/sh -c docker images -a
2023/07/05 04:24:15.293311 [INFO] REPOSITORY TAG IMAGE ID CREATED SIZE
aws_beanstalk/current-app latest 127a3e1be9bf 9 seconds ago 2.34GB
528729501303.dkr.ecr.ap-northeast-2.amazonaws.com/roa-advertiser latest d00a89acf429 2 weeks ago 2.34GB
2023/07/05 04:24:15.293359 [INFO] Running command /bin/sh -c docker rmi `docker images -aq`
2023/07/05 04:24:15.440184 [INFO] Error response from daemon: conflict: unable to delete 127a3e1be9bf (cannot be forced) - image is being used by running container 6d7718357199
Error response from daemon: conflict: unable to delete d00a89acf429 (cannot be forced) - image has dependent child images
2023/07/05 04:24:15.440226 [INFO] Running command /bin/sh -c docker images -a
2023/07/05 04:24:15.504625 [INFO] REPOSITORY TAG IMAGE ID CREATED SIZE
aws_beanstalk/current-app latest 127a3e1be9bf 9 seconds ago 2.34GB
528729501303.dkr.ecr.ap-northeast-2.amazonaws.com/roa-advertiser latest d00a89acf429 2 weeks ago 2.34GB
I'm sure, stop ec2 then it will be work, directly. because, new beanstalk environment with same setting is working well. As far as I know, Beanstalk manages containers, but there seems to be a problem with that.