You have now installed Docker on your system! Now we can install nvidia-docker
Install nvidia-docker
Once you're strong enough, save the world:
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containersdockervolumels-q-fdriver=nvidia-docker|xargs-r-I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -fsudoapt-getpurge-ynvidia-docker# Add the package repositoriescurl-s-Lhttps://nvidia.github.io/nvidia-docker/gpgkey| \sudoapt-keyadd-distribution=$(./etc/os-release;echo $ID$VERSION_ID)curl-s-Lhttps://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list| \sudotee/etc/apt/sources.list.d/nvidia-docker.listsudoapt-getupdate# Install nvidia-docker2 and reload the Docker daemon configurationsudoapt-getinstall-ynvidia-docker2sudopkill-SIGHUPdockerd
Reboot your system now!
All in One Installer
sudoadd-apt-repository-yppa:graphics-drivers/ppasudoapt-getupdatesudoapt-get-yinstall $(ubuntu-driverslist|sort|uniq|tail-n1)#Reboot Recommended Heresudoapt-get-yremovedockerdocker-enginedocker.iocontainerdruncsudoapt-get-yinstall \apt-transport-https \ca-certificates \curl \gnupg-agent \software-properties-commoncurl-fsSLhttps://download.docker.com/linux/ubuntu/gpg|sudoapt-keyadd-sudoadd-apt-repository-y \"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release-cs) \ stable"sudoapt-getupdatesudoapt-getinstall-ydocker-cedocker-ce-clicontainerd.iosudocurl-L"https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname-s)-$(uname-m)"-o/usr/local/bin/docker-composesudochmod+x/usr/local/bin/docker-composesudogroupadddockersudousermod-aGdocker $USERsudochown"$USER":"$USER"/home/"$USER"/.docker-Rsudochmodg+rwx"$HOME/.docker"-R#Reboot Recommended Here# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containersdockervolumels-q-fdriver=nvidia-docker|xargs-r-I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -fsudoapt-getpurge-ynvidia-docker# Add the package repositoriescurl-s-Lhttps://nvidia.github.io/nvidia-docker/gpgkey| \sudoapt-keyadd-distribution=$(./etc/os-release;echo $ID$VERSION_ID)curl-s-Lhttps://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list| \sudotee/etc/apt/sources.list.d/nvidia-docker.listsudoapt-getupdate# Install nvidia-docker2 and reload the Docker daemon configurationsudoapt-getinstall-ynvidia-docker2sudopkill-SIGHUPdockerd#Reboot Recommended Here