mirror of
https://github.com/tiyn/dockerfiles.git
synced 2026-01-07 00:49:44 +01:00
41 lines
1.4 KiB
Markdown
41 lines
1.4 KiB
Markdown
# TensorFlow Nightly GPU VENV
|
|
|
|
This is a dockerized version of a TensorFlow virtual environment setup that works with a GPU.
|
|
This container and its documentation was made by [tiyn](https://github.com/tiyn) it is based on the
|
|
official [TensorFlow image](https://hub.docker.com/layers/tensorflow/tensorflow/nightly-gpu).
|
|
|
|
## Setup
|
|
|
|
Navigate into the `src` directory and build the image using the following command.
|
|
|
|
```sh
|
|
docker build . -t tf-nightly-gpu-venv
|
|
```
|
|
|
|
Then create a `rebuild.sh` file.
|
|
Change the settings according to your needs and run `./rebuild.sh` afterward.
|
|
|
|
### Environment-variables
|
|
|
|
Set the following variables with the -e tag.
|
|
|
|
| Name | Usage | Default |
|
|
| ------------- | --------------------------------------------------- | ----------- |
|
|
| `VIRTUAL_ENV` | Specifies the path to the virtual environment | `/opt/venv` |
|
|
|
|
### Volumes
|
|
|
|
Set the following volumes with the -v tag.
|
|
|
|
| Outside mount/volume name | Container mount | Description |
|
|
| ------------------------- | ---------------- | ------------------------------------- |
|
|
| `$(pwd)` | `/workspace/src` | directory containing the source files |
|
|
|
|
### rebuild.sh
|
|
|
|
```sh
|
|
docker stop tf-nightly-gpu-venv
|
|
docker rm tf-nightly-gpu-venv
|
|
docker run --name tf-nightly-gpu-venv --rm --gpus all -it -v "$(pwd):/workspace/src" -w /workspace/src -d tf-nightly-gpu-venv
|
|
```
|