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