Issues dockerizing a snapcraft build process

When you build using the built-in lxd containers, a suitable build environment that matches your base: setting is automatically used. If you run in destructive mode, you’re responsible for providing the environment that matches your base: configuration. That means that if your snap has base: core18 you need to use a bionic docker image, if it’s base: core20 then you need to use a focal docker image, and if you use base: core22 you need a jammy docker image. If you use a mismatched environment the result is unpredictable, you can have errors during the build and most likely the resulting snap will not work.