Skip to content

Instantly share code, notes, and snippets.

@ToQoz
Forked from kntyskw/start_docker_registry_on_eb.sh
Last active January 3, 2016 13:44
Show Gist options
  • Select an option

  • Save ToQoz/a8d615aecff99a59bd14 to your computer and use it in GitHub Desktop.

Select an option

Save ToQoz/a8d615aecff99a59bd14 to your computer and use it in GitHub Desktop.

Revisions

  1. ToQoz revised this gist Jan 3, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ docker run \
    --name registry \
    -e SETTINGS_FLAVOR=prod \
    -e DOCKER_REGISTRY_CONFIG=/docker-registry/config/config_sample.yml \
    -e AWS_BUCKET=$DOCKER_REPOSITORY_BUCKET \
    -e AWS_BUCKET=$DOCKER_REGISTRY_BUCKET \
    -e STORAGE_PATH=/ \
    -e AWS_KEY=$DOCKER_REGISTRY_AWS_ACCESS_KEY_ID \
    -e AWS_SECRET=$DOCKER_REGISTRY_AWS_SECRET_KEY \
  2. ToQoz revised this gist Jan 3, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -18,8 +18,8 @@ docker run \
    -e DOCKER_REGISTRY_CONFIG=/docker-registry/config/config_sample.yml \
    -e AWS_BUCKET=$DOCKER_REPOSITORY_BUCKET \
    -e STORAGE_PATH=/ \
    -e AWS_KEY=$AWS_ACCESS_KEY_ID \
    -e AWS_SECRET=$AWS_SECRET_KEY \
    -e AWS_KEY=$DOCKER_REGISTRY_AWS_ACCESS_KEY_ID \
    -e AWS_SECRET=$DOCKER_REGISTRY_AWS_SECRET_KEY \
    -e SEARCH_BACKEND=sqlalchemy \
    -p 49000:5000 -d \
    registry docker-registry
  3. @kntyskw kntyskw revised this gist Jun 4, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,7 @@ rm /tmp/env.sh
    docker run \
    --name registry \
    -e SETTINGS_FLAVOR=prod \
    -e DOCKER_REGISTRY_CONFIG=/docker-registry/config/config_sample.yml \
    -e AWS_BUCKET=$DOCKER_REPOSITORY_BUCKET \
    -e STORAGE_PATH=/ \
    -e AWS_KEY=$AWS_ACCESS_KEY_ID \
  4. @kntyskw kntyskw revised this gist Jun 4, 2014. 1 changed file with 13 additions and 6 deletions.
    19 changes: 13 additions & 6 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -23,9 +23,16 @@ docker run \
    -p 49000:5000 -d \
    registry docker-registry

    RET=false
    while [[ $RET != "true" ]]; do
    echo "Checking if the registry is up..."
    sleep 5
    RET=`curl http://127.0.0.1:49000/v1/_ping`
    done
    nRetry=0
    while [[ $((nRetry++)) < 3 ]]; do
    echo "Checking if the registry is up..."
    sleep 5
    RET=`curl http://127.0.0.1:49000/v1/_ping 2>1 /dev/null`
    if [[ $RET == "true" ]]; then
    echo "Registry container is up"
    exit 0
    fi
    done

    echo "Failed to launch registry container"
    exit 1
  5. @kntyskw kntyskw revised this gist Jun 4, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,6 @@ rm /tmp/env.sh
    docker run \
    --name registry \
    -e SETTINGS_FLAVOR=prod \
    -e DOCKER_REGISTRY_CONFIG=/docker-registry/config/config_s3.yml \
    -e AWS_BUCKET=$DOCKER_REPOSITORY_BUCKET \
    -e STORAGE_PATH=/ \
    -e AWS_KEY=$AWS_ACCESS_KEY_ID \
  6. @kntyskw kntyskw revised this gist May 23, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -24,9 +24,9 @@ docker run \
    -p 49000:5000 -d \
    registry docker-registry

    while [[ RET -ne 0 ]]; do
    sleep 5
    RET=false
    while [[ $RET != "true" ]]; do
    echo "Checking if the registry is up..."
    curl http://127.0.0.1:49000/v1/_ping
    RET=$?
    sleep 5
    RET=`curl http://127.0.0.1:49000/v1/_ping`
    done
  7. @kntyskw kntyskw revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ docker run \
    -e SETTINGS_FLAVOR=prod \
    -e DOCKER_REGISTRY_CONFIG=/docker-registry/config/config_s3.yml \
    -e AWS_BUCKET=$DOCKER_REPOSITORY_BUCKET \
    -e STORAGE_PATH=/images \
    -e STORAGE_PATH=/ \
    -e AWS_KEY=$AWS_ACCESS_KEY_ID \
    -e AWS_SECRET=$AWS_SECRET_KEY \
    -e SEARCH_BACKEND=sqlalchemy \
  8. @kntyskw kntyskw revised this gist May 22, 2014. 1 changed file with 9 additions and 2 deletions.
    11 changes: 9 additions & 2 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ chmod 600 /tmp/env.sh
    jq .docker.env[] $EB_CONFIG_FILE | tr -d \" > /tmp/env.sh

    source /tmp/env.sh
    #rm /tmp/env.sh
    rm /tmp/env.sh

    # Start docker repository with name "registry"
    docker run \
    @@ -22,4 +22,11 @@ docker run \
    -e AWS_SECRET=$AWS_SECRET_KEY \
    -e SEARCH_BACKEND=sqlalchemy \
    -p 49000:5000 -d \
    registry docker-registry >& /tmp/log
    registry docker-registry

    while [[ RET -ne 0 ]]; do
    sleep 5
    echo "Checking if the registry is up..."
    curl http://127.0.0.1:49000/v1/_ping
    RET=$?
    done
  9. @kntyskw kntyskw revised this gist May 22, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -21,5 +21,5 @@ docker run \
    -e AWS_KEY=$AWS_ACCESS_KEY_ID \
    -e AWS_SECRET=$AWS_SECRET_KEY \
    -e SEARCH_BACKEND=sqlalchemy \
    -p 49000:5000 \
    -p 49000:5000 -d \
    registry docker-registry >& /tmp/log
  10. @kntyskw kntyskw revised this gist May 22, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ chmod 600 /tmp/env.sh
    jq .docker.env[] $EB_CONFIG_FILE | tr -d \" > /tmp/env.sh

    source /tmp/env.sh
    rm /tmp/env.sh
    #rm /tmp/env.sh

    # Start docker repository with name "registry"
    docker run \
    @@ -22,4 +22,4 @@ docker run \
    -e AWS_SECRET=$AWS_SECRET_KEY \
    -e SEARCH_BACKEND=sqlalchemy \
    -p 49000:5000 \
    registry docker-registry
    registry docker-registry >& /tmp/log
  11. @kntyskw kntyskw created this gist May 22, 2014.
    25 changes: 25 additions & 0 deletions start_docker_registry_on_eb.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/bin/bash

    . /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

    source /tmp/env.sh
    rm /tmp/env.sh

    # Start docker repository with name "registry"
    docker run \
    --name registry \
    -e SETTINGS_FLAVOR=prod \
    -e DOCKER_REGISTRY_CONFIG=/docker-registry/config/config_s3.yml \
    -e AWS_BUCKET=$DOCKER_REPOSITORY_BUCKET \
    -e STORAGE_PATH=/images \
    -e AWS_KEY=$AWS_ACCESS_KEY_ID \
    -e AWS_SECRET=$AWS_SECRET_KEY \
    -e SEARCH_BACKEND=sqlalchemy \
    -p 49000:5000 \
    registry docker-registry