It's not a PVE question per-se, yet it works perfectly fine. The easiest steps would be:
- boot a live linux inside of your VM
- tar the filesystem and store it "outside" of the VM and compress it with e.g. gzip
- use this file as a template for creating an LX(C) container
This is the easiest method, not the best. I would then further optimize it by removing stuff like kernel, grub and everything else boot related (e.g. efi stuff).
I'm running a couple of Oracle Linux VMs in various setup (e.g. including oracle database) for quick tests.
Here a couple of other threads about this:
https://forum.proxmox.com/threads/custom-lxc-templates.28832/post-144890
https://forum.proxmox.com/threads/proxmox-lxc-container-template-configuration.108071/post-464470