Snapcraft in container

Hi,

I am trying to build my snap using a snapcraft in a docker container.

root@aca534dc1fc0:/data/build/linux/snap-build# snapcraft 
LXD is required but not installed. Do you wish to install LXD and configure it with the defaults? [y/N]: N                                                                              
craft-providers error: LXD is required, but not installed. Visit https://snapcraft.io/lxd for instructions on how to install the LXD snap for your distribution                         
Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20240320-115727.199597.log' 

is it possible to LXD within docker?

1 Like

try with the --destructive-mode option … or by exporting SNAPCRAFT_BUILD_ENVIRONMENT=host

that will prevent any container or VM creation but will also potentially trash your build system (i.e. being destructive :wink: )

1 Like

Thank you! Now I got a different error.

2024-03-20 21:37:00.630 :: + craftctl default
2024-03-20 21:37:00.631 :: /bin/bash: line 48: craftctl: command not found
2024-03-20 21:37:00.845 'override-build' in part 'gsettings+pixbuf+immodules' failed with code 127.
Review the scriptlet and make sure it's correct.

craftctl is missing. I looked at the snapcraft snap bin but couldn’t find it.