Skip to content

Instantly share code, notes, and snippets.

@kairos03
Last active July 10, 2019 01:45
Show Gist options
  • Save kairos03/d4511f8a69fd52c78c6a433e5a28cfbb to your computer and use it in GitHub Desktop.
Save kairos03/d4511f8a69fd52c78c6a433e5a28cfbb to your computer and use it in GitHub Desktop.
MLVC Docker Manual

MLVC_Docker Manual

0. Images

mlvc/pytorch

Installed applications

app ver
vim
git
openssh-server
python 3.6.8

Installed python packages

package ver
pytorch 1.0.1
torchvision 0.2.2
numpy 1.15.4
pandas 0.24.2
scikit-learn 0.20.3
scipy 1.2.1

1. Quick Start

Make container

$ nvidia-docker run -it --name YOUR_CONTAINER_NAME mlvc/pytorch
$ 

List container

$ docker ps     // active container
$ docker ps -a  // all container

Remove container

WARNING: Be careful. Deleted container cannot be restored. DO NOT DELETE other user's container.

$ docker rm <CONTAINER_ID>
or
$ docker rm <CONTAINER_NAME>

2. Multi GPU

In multi GPU system, Each container can use specefic GPUs.

$ NV_GPU=0,1 nvidia-docker -it <IMAGE>

3. Make container options

Port mapping

$ nvidia-docker -it -p HOST:CONTAINER <IMAGE>
ex) ssh port mapping
$ nvidia-docer -it -p 2211:22 mlvc/pytorch

Sharing volume

$ nvidia-docker -it -v /HOST/DIR:/CONTAINER/DIR <IMAGE>
ex)
$ nvidia-docker -it -v /data:/data mlvc/pytorch

4. ETC

Use ssh

The mlvc/pytorch image already installed ssh server You can use ssh after following commands.

// make container
$ nvidia-docer -it -p <outer port>:22 mlvc/pytorch 

Be sure, the HOST port can allready used. Request port number to junhyn, server manager.

In Container

# service ssh restart
# passwd    // change root password

Access is same as common.

ssh root@<host> -P <port>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment