-
Install Docker:
sudo pacman -S docker
-
Enable Docker systemctl unit:
sudo systemctl enable docker.service sudo systemctl enable containerd.service
-
Allow X access to containers:
xhost +si:localuser:$USER
-
Install distrobox:
curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sudo sh
-
Create an ubuntu distrobox image with mounted docker.sock:
distrobox create --name ubuntu-22-04 --image ubuntu:22.04 --volume /var/run/docker.sock:/var/run/docker.sock
-
The following steps should be executed in the distrobox container. Enter the distrobox container shell:
distrobox enter ubuntu-22-04
-
Install Docker CLI and common plugins (Docker installation taken from official docs):
sudo chmod 666 /var/run/docker.sock sudo apt-get update sudo apt-get install ca-certificates curl gnupg lsb-release sudo mkdir -m 0755 -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-cli docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker $USER docker info
-
Install VSCode (download x64 .deb package here):
sudo dpkg -i ~/Downloads/code_1.76.2-1678817801_amd64.deb sudo apt-get -f install
-
Allow host xdg-open to process requests from inside the distrobox container:
sudo ln -s /usr/bin/distrobox-host-exec /usr/local/bin/xdg-open
-
Export VSCode shortcut:
distrobox-export --app code
Everything else should work as usual.
sudo chmod 666 /var/run/docker.sock
fix