Running Docker in LXC Container

Running Docker in LXC Container

Introduction

Proxmox official support always recommend to run Docker in VMs, not in LXC container for their reasons and else. However, VMs require more resources from the hypervisor and much slower compare to lxc container especially the boot speeds. Docker is container system and so is lxc, so basically you’re trying to run container inside container, or … containerception.

alter-text

Now seriously, running docker in LXC is advised against by the proxmox developers. Any update on the proxmox system can change how docker in LXC behaves and blah and blah and blah. But hey, this is my hardware and my installation ☺️.
Okay, carry on, just recently, I do have some urgent task to do a quick fix for one of my django project and I need some quick development server to working on and I use tools named as fuse-overlayfs that works pretty good to overcome the docker inside lxc issue, and below is the steps.

Installation steps

So, here is the steps to deploy docker container in lxc container on proxmox with zfs storage backend :

  • Create unprivileged LXC container or CT from proxmox templates
  • Enable the fuse=1,keyctl=1,nesting=1 features in CT options settings
  • Run the container and install fuse-overlayfs
    You can use apt install fuse-overlayfs if on ubuntu, or pacman -S fuse-overlayfs if on arch and apk add fuse-overlayfs if on alpine.
  • Install docker-ce and docker-compose as usual
  • Add your user to docker group and reboot
  • After reboot try to deploy your project using docker-compose
  • Working on the project

That’s it, that’s all the steps, I can finishing my fix without problem and no observable issues could be detected with the docker performance or LXC itself.

See you next time.

comments powered by Disqus

Related Posts

Transcend Tranquility

Transcend Tranquility

drifting along on the wave of tranquility ...

Read More
ili9341 SPI TFT screen on buster

ili9341 SPI TFT screen on buster

Just recently bought this cheap ili9341 spi tft lcd from online store and want to test it whether it’s working or not.

Read More
Blues Books

Blues Books

So I laid down to dream to a little while .

Read More