Skip to content

Commit

Permalink
add condition for running on macOS
Browse files Browse the repository at this point in the history
check the $OSTYPE and conditional use port forwarding on macOS or host networking on Linux. Note that host networking only works on Linux as of now.
  • Loading branch information
cicorias authored Aug 23, 2019
1 parent 07717a6 commit cd91846
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion launch-docker-cpu.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# USAGE - ./launch-docker-cpu.sh {abs-path-to-GDL-code}
docker run --rm --network=host -it -v $1:/GDL gdl-image-cpu
# - eg. to run from current directory:
# ./launch-docker-cpu.sh $(pwd)
if [[ "$OSTYPE" == "darwin"* ]]; then
docker run --rm -p 8888:8888 -it -v $1:/GDL gdl-image-cpu
else
docker run --rm --network=host -it -v $1:/GDL gdl-image-cpu
fi

0 comments on commit cd91846

Please sign in to comment.