Skip to content

Commit

Permalink
fix flags in BVLC#3518 for nvidia-docker
Browse files Browse the repository at this point in the history
nvidia-docker requires long args with equal sign as of docker 1.10:
see BVLC#3518 (comment)
  • Loading branch information
shelhamer authored and zouxiaochuan committed Feb 15, 2017
1 parent df6f630 commit 844f732
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 16 deletions.
12 changes: 0 additions & 12 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ docker run -ti caffe:cpu bash -c "cd /opt/caffe/build; make runtest"

In order to get the most out of the caffe image, some more advanced `docker run` options could be used. For example, running:
```
<<<<<<< HEAD
docker run -ti --volume=$(pwd):/workspace caffe:cpu caffe train --solver=example_solver.prototxt
```
will train a network defined in the `example_solver.prototxt` file in the current directory (`$(pwd)` is maped to the container volume `/workspace` using the `--volume=` Docker flag).
Expand All @@ -38,17 +37,6 @@ Note that docker runs all commands as root by default, and thus any output files
docker run -ti --volume=$(pwd):/workspace -u $(id -u):$(id -g) caffe:cpu caffe train --solver=example_solver.prototxt
```
where the `-u` Docker command line option runs the commands in the container as the specified user, and the shell command `id` is used to determine the user and group ID of the current user. Note that the Caffe docker images have `/workspace` defined as the default working directory. This can be overridden using the `--workdir=` Docker command line option.
=======
docker run -ti --volume $(pwd):/workspace caffe:cpu caffe train --solver=example_solver.prototxt
```
will train a network defined in the `example_solver.prototxt` file in the current directory (`$(pwd)` is maped to the container volume `/workspace` using the `--volume` Docker flag).
Note that docker runs all commands as root by default, and thus any output files (e.g. snapshots) generated will be owned by the root user. In order to ensure that the current user is used instead, the following command can be used:
```
docker run -ti --volume $(pwd):/workspace -u $(id -u):$(id -g) caffe:cpu caffe train --solver=example_solver.prototxt
```
where the `-u` Docker command line option runs the commands in the container as the specified user, and the shell command `id` is used to determine the user and group ID of the current user. Note that the Caffe docker images have `/workspace` defined as the default working directory. This can be overridden using the `--workdir` Docker command line option.
>>>>>>> Add Dockerfiles for creating Caffe executable images.

# Other use-cases

Expand Down
4 changes: 0 additions & 4 deletions examples/mnist/train_lenet_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ fi
# /workspace
# --workdir /workspace Ensures that the docker container starts in the right
# working directory
<<<<<<< HEAD
DOCKER_OPTIONS="--rm -ti -u $CUID:$CGID --volume=$(pwd):/workspace --workdir=/workspace"
=======
DOCKER_OPTIONS="--rm -ti -u $CUID:$CGID --volume $(pwd):/workspace --workdir /workspace"
>>>>>>> Add Dockerfiles for creating Caffe executable images.
DOCKER_RUN="$DOCKER_CMD run $DOCKER_OPTIONS $IMAGE"

# Download the data
Expand Down

0 comments on commit 844f732

Please sign in to comment.