Skip to content

Commit c842c58

Browse files
committed
TensorFlow: Add a port mapping option for docker command.
Changes: * Add port mapping options to `docker run` commands in docker_run_gpu.sh and README.md. Docker on Mac needs an extra option `-p` to expose 8888 for Jupyter Notebook. The added option makes the behavior of containers consistent on both Ubuntu and Mac. Change-Id: I29002329f08d7dc05415925e9b2aedbd3f112813
1 parent 17b095c commit c842c58

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tensorflow/tools/docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ We currently maintain three Docker container images:
3131
Each of the containers is published to a Docker registry; for the non-GPU
3232
containers, running is as simple as
3333

34-
$ docker run -it b.gcr.io/tensorflow/tensorflow
34+
$ docker run -it -p 8888:8888 b.gcr.io/tensorflow/tensorflow
3535

3636
For the container with GPU support, we require the user to make the appropriate
3737
NVidia libraries available on their system, as well as providing mappings so
@@ -40,7 +40,7 @@ accomplished via
4040

4141
$ export CUDA_SO=$(\ls /usr/lib/x86_64-linux-gnu/libcuda* | xargs -I{} echo '-v {}:{}')
4242
$ export DEVICES=$(\ls /dev/nvidia* | xargs -I{} echo '--device {}:{}')
43-
$ docker run -it $CUDA_SO $DEVICES b.gcr.io/tensorflow/tensorflow-devel-gpu
43+
$ docker run -it -p 8888:8888 $CUDA_SO $DEVICES b.gcr.io/tensorflow/tensorflow-devel-gpu
4444

4545
Alternately, you can use the `docker_run_gpu.sh` script in this directory.
4646

tensorflow/tools/docker/docker_run_gpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ if [[ "${DEVICES}" = "" ]]; then
3434
exit 1
3535
fi
3636

37-
docker run -it $CUDA_SO $DEVICES b.gcr.io/tensorflow/tensorflow-full-gpu "$@"
37+
docker run -it -p 8888:8888 $CUDA_SO $DEVICES b.gcr.io/tensorflow/tensorflow-full-gpu "$@"

0 commit comments

Comments
 (0)