Ru7z / Dockerfiles

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dockerfiles

Docker

Install using the repository

$ sudo apt update && sudo apt upgrade -y && sudo apt install docker.io -y

Manage Docker as a non-root user

  • Add the docker group if it doesn't already exist:

     $ sudo groupadd docker
  • Add the connected user "$USER" to the docker group. Change the user name to match your preferred user if you do not want to use your current user:

     $ sudo gpasswd -a $USER docker
  • Either do a newgrp docker or log out/in to activate the changes to groups.

     $ newgrp docker

Docker Engine Utility for NVIDIA GPUs

Prerequisites

Install Cuda on Ubuntu

install dependences

 $ sudo apt update && apt upgrade -y
 $ sudo apt install gcc -y
 $ sudo apt install build-essential -y

CUDA Install

  • Download CUDA: runfile (local)
  • Check the md5 sum: md5sum cuda_9.1.85_387.26_linux.run
$ sudo sh cuda_9.1.85_387.26_linux --override

CUDA Environment

$ sudo emacs -nw /etc/ld.so.conf.d/cuda.conf
/usr/local/cuda-9.1/lib64
$ sudo emacs -nw ~/.bash_profile
export PATH=$PATH:/usr/local/cuda-9.1/bin
$ source ~/.bash_profile

Verify CUDA installation

$ nvcc -V
$ nvidia-smi

Docker CE

Uninstall old versions

$ sudo apt remove docker docker-engine docker.io

Install using the repository

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 \
      $(lsb_release -cs) \
      stable"

sudo apt install docker-ce -y

NVIDIA-docker(version 2.0)

add Ubuntu distributions

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

Install

sudo apt update
sudo apt install nvidia-docker2 -y
sudo pkill -SIGHUP dockerd

Usage

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

Registry

TODO: daocloud.io

About


Languages

Language:Shell 72.2%Language:Dockerfile 27.8%