Hello Docker!

A Record for docker enviorenment install.

1.install docker

1
2
3
4
5
6
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
sudo apt-get update && apt-get install docker-ce

#sudo docker run hello-world

2.install nvidia-docker

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update && apt-get install nvidia-docker2

sudo tee /etc/docker/daemon.json <<EOF
{
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}
}
EOF
sudo pkill -SIGHUP dockerd

#sudo nvidia-docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi

3.install docker-compose

1
2
3
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
#docker-compose --version

4.build

1
xhost +"local:docker@"

5.run