Skip to content

Instantly share code, notes, and snippets.

@phdelodder
Last active September 9, 2020 09:22
Show Gist options
  • Save phdelodder/cccf8dc7037077b289c6122270c64fae to your computer and use it in GitHub Desktop.
Save phdelodder/cccf8dc7037077b289c6122270c64fae to your computer and use it in GitHub Desktop.
Run docker in lxc proxmox
  1. On the Proxmox host, edit /etc/modules-load.d/modules.conf to add these modules:
aufs
overlay
  1. Reboot or load the modules using modprobe:
modprobe aufs
modprobe overlay
  1. Create a unprivilegd container in Proxmox, don't start it
  2. Go to the container options and enable the features nesting and keyctl or manually this line to the config file:
features: keyctl=1,nesting=1
  1. Start the container
  2. Install required software
sudo apt update && apt upgrade -y
sudo apt install apt-transport-https ca-certificates curl gnupg2 software-properties-common

7a. apt config for debian

curl -fsSL download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"

7b. apt config for ubuntu

curl -fsSL download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  1. Install the docker software
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io docker-compose
  1. Running and managing docker containers requires sudo privileges. If you don’t want to type sudo for every commmand, add your current user to the docker group.
sudo usermod -aG docker ${USER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment