Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2014
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # Check if the registry image is already installed
  4. IS_INSTALLED=`docker images | grep -E 'registry\s*latest' | wc -l`
  5.  
  6. if [ $IS_INSTALLED == 0 ]; then
  7. . /opt/elasticbeanstalk/hooks/common.sh
  8.  
  9. # Load ElasticBeanstalk environment variables
  10. touch /tmp/env.sh
  11. chmod 600 /tmp/env.sh
  12.  
  13. # jq .docker.env[] $EB_CONFIG_FILE | tr -d \" > /tmp/env.sh
  14. jq '.["optionsettings"]["aws:elasticbeanstalk:application:environment"][]' /opt/elasticbeanstalk/deploy/configuration/containerconfiguration | tr -d \" > /tmp/env.sh
  15.  
  16. source /tmp/env.sh
  17. rm /tmp/env.sh
  18.  
  19. echo "Downloading registry image"
  20. aws s3 cp s3://$DOCKER_REPOSITORY_BUCKET/registry-image.tgz /tmp/registry-image.tgz
  21. echo "Installing registry image"
  22. # cat /tmp/registry-image.tgz | docker import - registry:latest
  23. docker load < /tmp/registry-image.tgz
  24.  
  25. else
  26. echo "registry image has been installed"
  27. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement