Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scripts to mirror databoxsystems from docker hub #154

Merged
merged 2 commits into from Oct 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions scripts/registry/README.md
@@ -0,0 +1,26 @@
# Mirror databoxsystems from docker hub

When running demos and hack days there can be issues with external network connectivity. Instilling databox and the SDK requires around 3GB per install.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"instilling" -> "installing"


These scripts will let you quickly set up a local mirror and distribute the image locally to the participants.

## Create a local mirror of the databox registry

First chose the machine you wish to use as a mirror and run

```
docker run -d -p 5000:5000 --restart always --name registry registry:2

then

./mirror 127.0.0.1:500
```

This will seed all the needed image in to a local registry. Your participants should than be instructed to install databox using the instructions. But before running databox-start they should run

```
./scripts/scripts/registry/seedFromMirror [IP-AND-PORT-OF-YOUR-MIRROR]

```

This will pre populate their local image caches with the images required from your local registry.
52 changes: 52 additions & 0 deletions scripts/registry/mirror
@@ -0,0 +1,52 @@
#!/bin/bash


if ! [ -x "$(command -v docker)" ]; then
echo 1 "docker is not installed see https://docs.docker.com/engine/installation/"
exit 1
fi


usage() {
echo $#
echo "Please invoke this script with the IP of the local registry you want to mirror to."
echo "Usage: mirror [registry host name and port]"
echo "Flags:"
echo "-h This help message"
exit 1
}

if [[ $# < 1 ]] || [[ "$1" == "-h" ]] # Must have more than 1 args.
then
usage
fi

clone () {
docker pull $1
docker tag $1 $2
docker push $2
}

clone databoxsystems/store-json $1/store-json
clone databoxsystems/driver-os-monitor $1/driver-os-monitor
clone databoxsystems/driver-twitter $1/driver-twitter
clone databoxsystems/driver-sensingkit $1/driver-sensingkit
clone databoxsystems/app-light-graph $1/app-light-graph
clone databoxsystems/arbiter $1/arbiter
clone databoxsystems/container-manager $1/container-manager
clone databoxsystems/export-service $1/export-service
clone databoxsystems/app-server $1/app-server
clone databoxsystems/driver-google-takeout $1/driver-google-takeout
clone databoxsystems/app-twitter-sentiment $1/app-twitter-sentiment
clone databoxsystems/base-image-ocaml $1/base-image-ocaml
clone databoxsystems/driver-phillips-hue $1/driver-phillips-hue
clone databoxsystems/app-os-monitor $1/app-os-monitor
clone databoxsystems/store-timeseries $1/store-timeseries
clone databoxsystems/driver-tplink-smart-plug $1/driver-tplink-smart-plug
clone node:alpine $1/node:alpine

clone tlodge/databox-redis $1/databox-redis
clone tlodge/databox-sdk $1/databox-sdk
clone tlodge/databox-test-server $1/databox-test-server
clone tlodge/databox-redis $1/databox-redis
clone tlodge/mongo $1/mongo
51 changes: 51 additions & 0 deletions scripts/registry/seedFromMirror
@@ -0,0 +1,51 @@
#!/bin/bash


if ! [ -x "$(command -v docker)" ]; then
echo 1 "docker is not installed see https://docs.docker.com/engine/installation/"
exit 1
fi


usage() {
echo $#
echo "Please invoke this script with the IP of the local registry you want pull from."
echo "Usage: seedFromMirror [registry host name and port]"
echo "Flags:"
echo "-h This help message"
exit 1
}

if [[ $# < 1 ]] || [[ "$1" == "-h" ]] # Must have more than 1 args.
then
usage
fi

seed () {
docker pull $2
docker tag $2 $1
}

seed $1/store-json databoxsystems/store-json
seed $1/driver-os-monitor databoxsystems/driver-os-monitor
seed $1/driver-twitter databoxsystems/driver-twitter
seed $1/driver-sensingkit databoxsystems/driver-sensingkit
seed $1/app-light-graph databoxsystems/app-light-graph
seed $1/arbiter databoxsystems/arbiter
seed $1/container-manager databoxsystems/container-manager
seed $1/export-service databoxsystems/export-service
seed $1/app-server databoxsystems/app-server
seed $1/driver-google-takeout databoxsystems/driver-google-takeout
seed $1/app-twitter-sentiment databoxsystems/app-twitter-sentiment
seed $1/base-image-ocaml databoxsystems/base-image-ocaml
seed $1/driver-phillips-hue databoxsystems/driver-phillips-hue
seed $1/app-os-monitor databoxsystems/app-os-monitor
seed $1/store-timeseries databoxsystems/store-timeseries
seed $1/driver-tplink-smart-plug databoxsystems/driver-tplink-smart-plug
seed $1/node:alpine node:alpine

seed $1/databox-redis tlodge/databox-redis
seed $1/databox-sdk tlodge/databox-sdk
seed $1/databox-test-server tlodge/databox-test-server
seed $1/databox-redis tlodge/databox-redis
seed $1/mongo tlodge/mongo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to get @tlodge components moved under me-box (if they're core components anyway)