gdebug: fix start_docker.sh for osx (#318)
mktemp works differently on osx. Pipe the config to stdin to avoid the problem. This supersedes https://github.com/grpc/grpc-experiments/pull/312
This commit is contained in:
parent
07a67c9c5c
commit
fbd5048f34
|
|
@ -12,19 +12,12 @@ fi
|
||||||
|
|
||||||
readonly DOCKER_DIR="$(cd "$(dirname "$0")" && pwd)"
|
readonly DOCKER_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
|
||||||
TEMP=$(mktemp -p $DOCKER_DIR --suffix=.yaml)
|
|
||||||
function finish {
|
|
||||||
rm "$TEMP"
|
|
||||||
}
|
|
||||||
trap finish EXIT
|
|
||||||
|
|
||||||
readonly ENVOY_PORT=$1
|
readonly ENVOY_PORT=$1
|
||||||
readonly GRPC_ADDR=$2
|
readonly GRPC_ADDR=$2
|
||||||
readonly GRPC_PORT=$3
|
readonly GRPC_PORT=$3
|
||||||
readonly ASSETS_PORT="8080"
|
readonly ASSETS_PORT="8080"
|
||||||
|
|
||||||
cat > "$TEMP" <<TERMINATOR
|
readonly CONFIG="version: '2'
|
||||||
version: '2'
|
|
||||||
services:
|
services:
|
||||||
front-envoy:
|
front-envoy:
|
||||||
build:
|
build:
|
||||||
|
|
@ -32,7 +25,7 @@ services:
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
ports:
|
ports:
|
||||||
# Forward host port to docker
|
# Forward host port to docker
|
||||||
- "$ENVOY_PORT:$ENVOY_PORT"
|
- '$ENVOY_PORT:$ENVOY_PORT'
|
||||||
environment:
|
environment:
|
||||||
- GRPC_HOST=$GRPC_ADDR
|
- GRPC_HOST=$GRPC_ADDR
|
||||||
- GRPC_PORT=$GRPC_PORT
|
- GRPC_PORT=$GRPC_PORT
|
||||||
|
|
@ -42,7 +35,7 @@ services:
|
||||||
- ASSETS_HOST=127.0.0.1
|
- ASSETS_HOST=127.0.0.1
|
||||||
- ASSETS_PORT=$ASSETS_PORT
|
- ASSETS_PORT=$ASSETS_PORT
|
||||||
mem_limit: 1000000000
|
mem_limit: 1000000000
|
||||||
network_mode: "host"
|
network_mode: 'host'
|
||||||
back-static-assets:
|
back-static-assets:
|
||||||
build:
|
build:
|
||||||
context: ./static-assets/
|
context: ./static-assets/
|
||||||
|
|
@ -52,8 +45,8 @@ services:
|
||||||
ports:
|
ports:
|
||||||
# Make the port availble to linked dockers but no need
|
# Make the port availble to linked dockers but no need
|
||||||
# to forward to host machine.
|
# to forward to host machine.
|
||||||
- "$ASSETS_PORT:$ASSETS_PORT"
|
- '$ASSETS_PORT:$ASSETS_PORT'
|
||||||
mem_limit: 1000000000
|
mem_limit: 1000000000"
|
||||||
TERMINATOR
|
|
||||||
|
|
||||||
docker-compose -f $TEMP up --build
|
cd $DOCKER_DIR
|
||||||
|
echo "$CONFIG" | docker-compose -f - up --build
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue