2016-08-01 16:44:11 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-02-28 18:57:51 -08:00
|
|
|
while [[ $# -gt 0 ]]
|
|
|
|
do
|
|
|
|
key="$1"
|
|
|
|
case $key in
|
|
|
|
--no-cache)
|
|
|
|
NO_CACHE="--no-cache"
|
|
|
|
;;
|
|
|
|
--skip-examples)
|
|
|
|
SKIP_EXAMPLES=YES
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Usage: build-docker.sh [ --no-cache ] [ --skip-examples ]"
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
2016-12-31 17:21:33 -08:00
|
|
|
|
2017-02-28 18:57:51 -08:00
|
|
|
# Build base dependencies, allow caching
|
|
|
|
docker build $NO_CACHE -t ray-project/base-deps docker/base-deps
|
|
|
|
|
|
|
|
# Build the current Ray source
|
|
|
|
git rev-parse HEAD > ./docker/deploy/git-rev
|
|
|
|
git archive -o ./docker/deploy/ray.tar $(git rev-parse HEAD)
|
2016-12-31 17:21:33 -08:00
|
|
|
docker build --no-cache -t ray-project/deploy docker/deploy
|
2017-02-28 18:57:51 -08:00
|
|
|
rm ./docker/deploy/ray.tar ./docker/deploy/git-rev
|
|
|
|
|
|
|
|
|
|
|
|
if [ ! $SKIP_EXAMPLES ]; then
|
|
|
|
docker build $NO_CACHE -t ray-project/examples docker/examples
|
|
|
|
fi
|