AWS Beanstalk docker image automatic update doesn't work

谁说我不能喝 提交于 2019-12-01 16:24:28

The documentation should be more clear. What they are saying is with update=true:

EBS will do a docker pull before it does a docker run when the application is first started. It will not continually poll docker hub.

In contrast, issuing a docker run without first doing a docker pull will always use the locally stored version of that machine, which may not always be the latest.

In order to acheive what you want, you'll need to set up a webhook on Docker Hub, that calls an application you control, that rebuilds your ELB app.

You can use the aws command-line tool to trigger the update:

aws elasticbeanstalk update-environment --application-name [your_app_name] --environment-name [your_environment_name] --version-label [your_version_label]

You specify the version that contains the Dockerrun.aws.json file, that way a new version won't be added to the application. In this case the Dockerrun file works as the "source" for the application, but it only tells aws to pull the docker image, so it would be redundant to create new versions for the application in Elastic Beanstalk (unless you use specifically tagged docker images in the Dockerrun file)

Links:

http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_image.html http://docs.aws.amazon.com/elasticbeanstalk/latest/api/API_UpdateEnvironment.htm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!