sudo systemctl start snapd
sudo apt-get install lxd
sudo lxc init
You'll be prompted with setup questions, I recommend keeping the defaults.
snapcraft cleanbuild
cleanbuild will automatically setup a new lxd container to execute your build. This makes for a completely clean build of your application.
snapcraft cleanbuild --debug
The following command will build the package in container and remain on failure. This gives you the opportunity to test and debug your build in a bash shell.
If you'd like to hear about it in more detail, here is snapcraft's official video on the subject.