-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed 'lib/killrvideo-docker-common/' changes from 0c67c94..be86c0f
be86c0f Merge pull request #3 from KillrVideo/dse-5.1.0-update bf4126c Update to new Docker image for DSE 5.1.0 19e1fac Switch to killrvideo-dse image a102c4b Create lo0 alias and use when doing Docker for Mac setup aa4f607 Don't need to specify IP to bind c60aebe Hardcode IPs on Docker for Mac 4c5d1d6 Specify IP when publishing ports ffcd0ee Make get environment script executable bc68e1e Make create environment script executable d887201 Add create environment shell script 58411ae Add a little documentation to shell script 0500cf9 Update shell script for docker toolbox setups f16318a Add COMPOSE_FILE to output git-subtree-dir: lib/killrvideo-docker-common git-subtree-split: be86c0f837500393e1e7f6c223f0d285ec6e71ba
- Loading branch information
Jeffrey Carpenter
authored and
Jeffrey Carpenter
committed
Apr 20, 2017
1 parent
9ee998a
commit e60a06e
Showing
4 changed files
with
82 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
set -e # Bail if something fails | ||
|
||
# This script tries to create a .env file in the current working directory for | ||
# use with docker-compose. The file contains variables that include info on the | ||
# user's docker setup like the IP address of the Host and VM. | ||
|
||
ENV_FILE_PATH="$PWD/.env" | ||
|
||
# TODO: Don't overwrite file if it already exists? | ||
|
||
# Relative path that contains this script | ||
SCRIPT_PATH=${BASH_SOURCE%/*} | ||
|
||
# Create an alias for the loopback adapter so that the Mac and Docker VM can communicate using that IP | ||
export LOOPBACK_IP='10.0.75.1' | ||
echo 'We need to create an alias for the loopback adapter (lo0) using sudo' | ||
echo 'so your Mac and the Docker VM can communicate. It will be created using' | ||
echo "IP $LOOPBACK_IP. You will be prompted for your password." | ||
sudo ifconfig lo0 alias $LOOPBACK_IP | ||
|
||
# Should use compose file relative to this script, followed by a compose file relative to the | ||
# working directory (i.e. where the .env file is going to be created) | ||
COMPOSE_FILE="$SCRIPT_PATH/docker-compose.yaml:./docker-compose.yaml" | ||
COMPOSE_PROJECT_NAME='killrvideo' | ||
|
||
# Get other variables from the get-environment.sh script | ||
GET_ENV_OUTPUT=$(exec $SCRIPT_PATH/get-environment.sh) | ||
|
||
# Write to .env file in current working directory | ||
echo "COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME | ||
COMPOSE_FILE=$COMPOSE_FILE | ||
$GET_ENV_OUTPUT" > $ENV_FILE_PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters