In Docker 1.10, including protocol in DOCKER_HOST caused failure to connect to daemon on host machine. Must have fixed in 1.11. (c) Copyright IBM Corp. 2016
28 lines
809 B
Bash
Executable File
28 lines
809 B
Bash
Executable File
#!/bin/bash
|
|
# Copyright (c) Jupyter Development Team.
|
|
# Distributed under the terms of the Modified BSD License.
|
|
|
|
# Wrapper script around docker-compose
|
|
|
|
set -e
|
|
|
|
for i in "$@" ; do
|
|
if [[ "$i" == "up" ]]; then
|
|
# Check for required environment variables on startup
|
|
if [ -z ${GITHUB_CLIENT_ID:+x} ]; then
|
|
echo "ERROR: Must set GITHUB_CLIENT_ID environment variable"; exit 1;
|
|
fi
|
|
if [ -z ${GITHUB_CLIENT_SECRET:+x} ]; then
|
|
echo "ERROR: Must set GITHUB_CLIENT_SECRET environment variable"; exit 1;
|
|
fi
|
|
if [ -z ${OAUTH_CALLBACK_URL:+x} ]; then
|
|
echo "ERROR: Must set OAUTH_CALLBACK_URL environment variable"; exit 1;
|
|
fi
|
|
|
|
# Set DOCKER_HOST to daemon of target machine
|
|
DOCKER_HOST=$(docker-machine url $(docker-machine active))
|
|
fi
|
|
done
|
|
|
|
exec docker-compose "$@"
|