Allow Docker build on macOS (#60375)
Summary:
This PR allows developers using macOS to build Docker images locally. The `basename $(mktemp -u)` part was suggested by seemethere; I modified it slightly to appease ShellCheck and because [Docker doesn't allow uppercase characters in tags](https://stackoverflow.com/a/54291205).
Pull Request resolved: https://github.com/pytorch/pytorch/pull/60375
Test Plan:
On a Mac:
```
cd .circleci/docker
./build.sh pytorch-linux-xenial-py3.6-gcc5.4
```
Reviewed By: driazati
Differential Revision: D29267025
Pulled By: samestep
fbshipit-source-id: ba27d2fb108f573a50db069cf9ddea0414ed6074
diff --git a/.circleci/docker/build.sh b/.circleci/docker/build.sh
index b107225..df41b93 100755
--- a/.circleci/docker/build.sh
+++ b/.circleci/docker/build.sh
@@ -320,7 +320,7 @@
JENKINS_GID=$(id -g jenkins)
fi
-tmp_tag="tmp-$(cat /dev/urandom | tr -dc 'a-z' | head -c 32)"
+tmp_tag=$(basename "$(mktemp -u)" | tr '[:upper:]' '[:lower:]')
# Build image
# TODO: build-arg THRIFT is not turned on for any image, remove it once we confirm