Last active
October 10, 2017 13:55
-
-
Save mrdrozdov/5059603b98e470ac8948de161c85f0e7 to your computer and use it in GitHub Desktop.
docker info
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CPU Only | |
We have caffe installed using docker on Dexter. Docker is a bit tricky, but it makes installation very simple so it is worth it. | |
To start a docker container with caffe, use this command: | |
docker run -v /home/dexter/Developer/caffe-docker/mount:/workspace/mount -ti bvlc/caffe:cpu bash | |
Here is what you need to know: | |
1. A docker container is like a mini server. Once started, we can ssh into it using the proper command. | |
2. Let's break down the command I gave above: | |
`-v /path/to/host/dir:/path/to/remote/dir` - This flag specifies a folder to mount onto docker. | |
`-ti` - This is a necessary flag. I'm not 100% sure what it does, but it's related to the shell. | |
`bvlc/caffe:cpu` - This is the name of the container we are going to start. | |
`bash` - This is the command to run on the container after it is started. We run bash so that we | |
can execute more commands once it is running. | |
3. Everytime that you do `docker run ...` it will start a *new* container. It won't have vim or tmux installed. | |
You can install those like this: | |
apt-get update | |
apt-get install tmux -y | |
apt-get install vim -y | |
4. If you exit bash after doing `docker run ...` then the docker container will stop. I recommend starting tmux on | |
dexter, and then doing `docker run ...`. You'll also need the next step. | |
5. Once you start the docker container, you might want to access it later. To do this, we'll use a different command: | |
docker exec -ti $CONTAINERID script -q -c "/bin/bash" /dev/null | |
This is like SSH for docker. You can get the $CONTAINERID by running `docker ps`. | |
# GPU Support | |
1. Replace `docker` with `nvidia-docker`. | |
2. Replace `bvlc/caffe:cpu` with `bvlc/caffe:gpu`. | |
3. For example: | |
nvidia-docker run -v /home/dexter/Developer/caffe-docker/mount:/workspace/mount -ti bvlc/caffe:gpu bash | |
# Caffe | |
Caffe and many other useful packages are already installed. If needed, caffe is located at `/opt/caffe`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment