An open API service indexing awesome lists of open source software.

https://github.com/uchuhimo/docker-bazel


https://github.com/uchuhimo/docker-bazel

Last synced: 6 months ago
JSON representation

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/
```