Working install of Docker-CE in LXC unprivileged container in Proxmox

Thanks so much for figuring this out, Ansfrid1066!

In case it’s helpful for anyone else, I created a shell script that works on an ubuntu18 template.

In the container, run the following:

apt-get update && \
  apt install curl gnupg2 -y && \
  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
  echo 'deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable' >> /etc/apt/sources.list && \
  apt-get update && \
  apt-get install docker-ce -y && \
  shutdown -h now

Note the VMID of your container. Then, on your Proxmox host, run the following:

VMID=113 # Replace this with the VMID of your container
echo 'features:  keyctl=1,nesting=1' | tee -a "/etc/pve/local/lxc/${VMID}.conf"

When you start your container again, you should be able to successfully run the following command:

docker run hello-world