https://github.com/uchuhimo/docker-bazel
https://github.com/uchuhimo/docker-bazel
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/uchuhimo/docker-bazel
- Owner: uchuhimo
- Created: 2018-08-17T15:14:21.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T12:10:38.000Z (almost 8 years ago)
- Last Synced: 2025-08-20T01:27:32.424Z (11 months ago)
- Language: Dockerfile
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# docker-bazel
Configure user:
- change `RUN useradd -m -u 2001 yxqiu` in Dockerfile to your user name/id.
Start container:
```
export BAZEL_WORKSPACE=/path/to/tensorflow
docker-compose build
docker-compose down
docker-compose up -d
```
Execute command in container:
```
docker-compose exec --user bazel python -V
```
Build TensorFlow from source (use v1.10.0 as example, check https://www.tensorflow.org/install/source for more details):
```
cd /path/to/tensorflow
git checkout v1.10.0
docker-compose exec --user bazel ./configure
# if GPU
docker-compose exec --user bazel bazel --output_user_root=/tmp/user_bazel/ build --config=mkl --config=cuda --config=opt //tensorflow/tools/pip_package:build_pip_package
# else if CPU
docker-compose exec --user bazel bazel --output_user_root=/tmp/user_bazel/ build --config=mkl --config=opt //tensorflow/tools/pip_package:build_pip_package
# end
docker-compose exec --user bazel bazel-bin/tensorflow/tools/pip_package/build_pip_package /tmp/tensorflow_pkg
docker-compose exec --user bazel cp /tmp/tensorflow_pkg/tensorflow-1.10.0-cp36-cp36m-linux_x86_64.whl /workspace/build/
# you can find the generated `.whl` file in /path/to/tensorflow/build/
```