In a CI environment where you know the shell runner is 20.04 and you’re using core20
you could use snapcraft --destructive-mode
- which is designed specifically for this use case. No nested VM, no LXD container, it builds on the “bare metal” (or VM). Use Ubuntu 18.04 for core18
snaps, and you’re set.
From the documentation " Destructive mode. Designed to be used in temporary/short-lived environments, such as on a CI system, because the build could contaminate the host build environment."