Skip to content

Instantly share code, notes, and snippets.

@p3jitnath
Last active June 26, 2025 20:17
Show Gist options
  • Save p3jitnath/d2aab27ff93a3a9d82dada1336c45041 to your computer and use it in GitHub Desktop.
Save p3jitnath/d2aab27ff93a3a9d82dada1336c45041 to your computer and use it in GitHub Desktop.

Revisions

  1. p3jitnath revised this gist Dec 30, 2020. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    # WARNING : This gist in the current form is a collection of command examples. Please exercise caution where mentioned.

    # Docker
    sudo apt-get update
    sudo apt-get remove docker docker-engine docker.io
    @@ -22,12 +24,12 @@ sudo systemctl restart docker
    # Check Docker image
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

    ## Erase all Docker images
    docker rmi -f $(docker images -a -q)
    ## Erase all Docker images [!!! CAUTION !!!]
    # docker rmi -f $(docker images -a -q)

    ## Erase one Docker image
    docker ps
    docker rmi -f image_id
    ## Erase one Docker image [!!! CAUTION !!!]
    # docker ps
    # docker rmi -f image_id

    ## Running GUI Applications
    xhost +local:docker
  2. p3jitnath revised this gist May 16, 2020. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -23,4 +23,15 @@ sudo systemctl restart docker
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

    ## Erase all Docker images
    docker rmi -f $(docker images -a -q)
    docker rmi -f $(docker images -a -q)

    ## Erase one Docker image
    docker ps
    docker rmi -f image_id

    ## Running GUI Applications
    xhost +local:docker
    docker run --gpus all -it \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    nathzi1505:darknet bash
  3. p3jitnath revised this gist May 16, 2020. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -20,4 +20,7 @@ sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
    sudo systemctl restart docker

    # Check Docker image
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi

    ## Erase all Docker images
    docker rmi -f $(docker images -a -q)
  4. p3jitnath revised this gist May 16, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,5 @@ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.li
    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
    sudo systemctl restart docker

    # Check docker image
    # Check Docker image
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
  5. p3jitnath revised this gist May 16, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -18,3 +18,6 @@ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.li

    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
    sudo systemctl restart docker

    # Check docker image
    docker run --gpus all nvidia/cuda:10.0-base nvidia-smi
  6. p3jitnath revised this gist May 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -8,6 +8,7 @@ docker --version

    # Put the user in the docker group
    sudo usermod -a -G docker $USER
    newgrp docker

    # Nvidia Docker
    sudo apt install curl
  7. p3jitnath revised this gist May 16, 2020. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,9 @@ sudo systemctl start docker
    sudo systemctl enable docker
    docker --version

    # Put the user in the docker group
    sudo usermod -a -G docker $USER

    # Nvidia Docker
    sudo apt install curl
    distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
  8. p3jitnath revised this gist May 16, 2020. No changes.
  9. p3jitnath revised this gist May 16, 2020. No changes.
  10. p3jitnath revised this gist May 16, 2020. No changes.
  11. p3jitnath revised this gist May 16, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,7 @@ sudo systemctl enable docker
    docker --version

    # Nvidia Docker
    sudo apt install curl
    distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
    curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
    curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
  12. p3jitnath revised this gist May 16, 2020. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,10 @@ sudo systemctl start docker
    sudo systemctl enable docker
    docker --version

    # Nvidia Docker
    distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
    curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
    curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list


    sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
    sudo systemctl restart docker
  13. p3jitnath created this gist May 16, 2020.
    10 changes: 10 additions & 0 deletions install-docker.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    # Docker
    sudo apt-get update
    sudo apt-get remove docker docker-engine docker.io
    sudo apt install docker.io
    sudo systemctl start docker
    sudo systemctl enable docker
    docker --version