amazon web services - How to add PRE deployment script to AWS Elastic Beanstalk Docker EC2 instance, custom AMI not working -


i'm liking fact i'm able use docker images pushed aws ecr elastic beanstalk. thing has given me headache lack of information on how add pre-deploy hooks elastic beanstalk ec2 instance?

if i've understood correctly, .ebextensions scripts run post deploy not resolving problem here.

i came solution added script needed run @ pre deploy phase eb ec2 instance manually. more directory:

/opt/elasticbeanstalk/hooks/appdeploy/pre

now script gets executed everytime deploy new application version instance want. if load balancer attached eb environment launches new eb instance, doesn't contain manually added script , therefore not able run application.

i tried create ami running eb ec2 container containing custom pre deploy script reason docker unable start on new eb instance based on custom ami.

eb-activity.log says:

[2016-08-29t07:38:36.580z] info  [3887]  - [initialization/preinitstage0/preinithook/01setup-docker-options.sh] : activity execution failed, because: stopping docker: [failed] starting docker:      ..........[failed (elasticbeanstalk::externalinvocationerror) caused by: stopping docker: [failed] starting docker:      ..........[failed] (executor::nonzeroexitstatus) 

if ssh eb instance , try start docker service manually, same result:

sudo service docker restart stopping docker:                                       [failed] starting docker:    ..........                         [failed] 

i highly appreciate if tell me correct way add pre deployment script elastic beanstalk, in advance :)

update

i solved ami problem launching new instance same ami elastic beanstalk uses default (aws-elasticbeanstalk-amzn-2016.03.3.x86_64-docker-hvm-201608240450). customized instance adding script /opt/elasticbeanstalk/hooks/appdeploy/pre though hooks directory structure:

/opt/elasticbeanstalk/hooks/ ├── appdeploy │   ├── enact │   ├── post │   └── pre ├── configdeploy │   ├── enact │   ├── post │   └── pre ├── postinit ├── preinit └── restartappserver     ├── enact     ├── post     └── pre  

isn't present @ fresh instance. directory structure generated when docker application deployed , scripts added directory structure in advance executed.

even though solves problem, use similar solution .ebextensions provide there similar support other post deploy scripts?


Comments

Popular posts from this blog

loops - Spock: How to use test data with @Stepwise -

amazon web services - S3 Pre-signed POST validate file type? -