Other distros docker engine install instructions here: https://docs.docker.com/engine/
Docker Desktop here: https://docs.docker.com/desktop/
Nvidia Graphics Cards (do docker install first): https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html
- The first step has you installing docker skip that part but do run: sudo systemctl --now enable docker
-
sudo apt-get remove docker docker-engine docker.io containerd runc
-
sudo apt-get update
-
sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release
-
sudo mkdir -p /etc/apt/keyrings
-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
-
echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
sudo apt-get update
-
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
-
sudo groupadd docker
-
sudo usermod -aG docker $USER
-
reboot the computer
<----------------------Docker is installed at this point----------------------------------->
Do the Nvidia install instructions if you have a Nvidia graphics card.
-
snap install --classic code
-
Go to the extensions with in vs code and install the following (They are all made by Microsft):
- Docker
- Remote - Containers
Create a Container: docker_howto.md
Docker is able to use wsl2 as the backend allowing you to more efficiently run a Linux container on Windows. (Windows 11 required for gui support)
- Guide for setting up docker on Windows with wsl2: https://docs.docker.com/desktop/windows/wsl/
- Guide for setting up wslg(gives gui support): https://github.com/microsoft/wslg
- If you want guis(for Linux):
xhost +local:docker &> /dev/null
- Start the container(for windows/wslg you can use the docker application or run this in the wsl terminal):
sudo docker start <name_of_container>
- Access the bash of the container:
sudo docker exec -it <name_of_container> bash
- See running containers:
sudo docker ps
- See all containers on computer:
sudo docker container list -a
- Stop the container once you are done:
sudo docker stop <name_of_container>
- When working with a usb device the easiest method is to give the container --privileged access when doing the docker run command. (This method does have security risks) Ensure to plug in the device before executing the "docker start ".
- If the container is already running use the stop command plug in usb device then execute the start command.