Skip to content

Commit

Permalink
docker.sh: Removed redsocks and added explicit exit 1 to make sure ma…
Browse files Browse the repository at this point in the history
…kefile realizes that compose failed

Signed-off-by: Marcel Wagner <[email protected]>
  • Loading branch information
wagmarcel authored and arkocal committed Apr 2, 2019
1 parent d70d373 commit f1aad93
Showing 1 changed file with 1 addition and 20 deletions.
21 changes: 1 addition & 20 deletions docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,5 @@ export GIT_COMMIT_GEARPUMP=$(git -C oisp-gearpump-rule-engine rev-parse HEAD)
export GIT_COMMIT_WEBSOCKET_SERVER=$(git -C oisp-websocket-server rev-parse HEAD)
export GIT_COMMIT_BACKEND=$(git -C oisp-backend rev-parse HEAD)

redsocks_container_name='redsocks'

if [ -n "$http_proxy" ] && [ -n "$https_proxy" ] && [ "$1" == "up" ]; then
# Run redsocks to allow containers to use proxy


if ! [[ $(docker ps -f "name=$redsocks_container_name" --format '{{.Names}}') == $redsocks_container_name ]]; then
echo "Starting redsocks..."

docker run -d --net=host --privileged --name $redsocks_container_name --rm -e http_proxy=$http_proxy -e https_proxy=$https_proxy klabs/forgetproxy
echo
fi
fi

docker-compose $*

if [ "$1" == "stop" ]; then
if [[ $(docker ps -f "name=$redsocks_container_name" --format '{{.Names}}') == $redsocks_container_name ]]; then
docker stop $redsocks_container_name
fi
fi
docker-compose $* || exit 1

0 comments on commit f1aad93

Please sign in to comment.