Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Check if the registry image is already installed
- IS_INSTALLED=`docker images | grep -E 'registry\s*latest' | wc -l`
- if [ $IS_INSTALLED == 0 ]; then
- . /opt/elasticbeanstalk/hooks/common.sh
- # Load ElasticBeanstalk environment variables
- touch /tmp/env.sh
- chmod 600 /tmp/env.sh
- # jq .docker.env[] $EB_CONFIG_FILE | tr -d \" > /tmp/env.sh
- jq '.["optionsettings"]["aws:elasticbeanstalk:application:environment"][]' /opt/elasticbeanstalk/deploy/configuration/containerconfiguration | tr -d \" > /tmp/env.sh
- source /tmp/env.sh
- rm /tmp/env.sh
- echo "Downloading registry image"
- aws s3 cp s3://$DOCKER_REPOSITORY_BUCKET/registry-image.tgz /tmp/registry-image.tgz
- echo "Installing registry image"
- # cat /tmp/registry-image.tgz | docker import - registry:latest
- docker load < /tmp/registry-image.tgz
- else
- echo "registry image has been installed"
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement