From ac96e2cc2df27e8fb0bdfd26f64fd843cd154f1e Mon Sep 17 00:00:00 2001 From: Ammar Qammaz Date: Wed, 25 Oct 2023 20:55:49 +0300 Subject: [PATCH] add a setup script for docker.. --- docker/setup.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 docker/setup.sh diff --git a/docker/setup.sh b/docker/setup.sh new file mode 100755 index 0000000..313ba8a --- /dev/null +++ b/docker/setup.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# This script builds and runs a docker image for local use. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd "$DIR" +cd .. +REPOSITORY=`pwd` + +cd "$DIR" + +#https://docs.nvidia.com/ai-enterprise/deployment-guide/dg-docker.html +sudo apt-get update +sudo apt-get install -y \ + apt-transport-https \ + ca-certificates \ + curl \ + gnupg-agent \ + software-properties-common + +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-get update +sudo apt-get install -y docker-ce docker-ce-cli containerd.io + +sudo docker run hello-world + + +#Make sure docker group is ok +sudo groupadd docker +sudo usermod -aG docker $USER +newgrp docker + +exit 0