Core22 in a Dockerfile?

Hi,

For a package we need gnome-42-2204 because it fixes an issue where video channels are inverted (so video result in blue faces in general).

So, we use core22, built https://github.com/snapcore/snapcraft/blob/main/docker/Dockerfile (with core22 and not core20).

Basically, we use ubuntu=jammy ; and copied the logic for core20 with core22

However, lxd or multipass are not installed, so this causes the build to fail because in the Docker we will see: “LXD is required but not installed. Do you wish to install LXD and configure it with the defaults? [y/N]:”

ENVIRONMENT=host can’t be used, cause “snap install snapcraft” will not work in the builder part ( https://github.com/snapcore/snapcraft/blob/main/docker/Dockerfile)

So, wondering what can be the good method to build a snap based with core22 (it was working fine 3 weeks ago.) inside a docker?

Second question, lxd with core22 also seems to fail:

“Ensure prerequisites for “snapcraft” are available (cannot install snap base “core20”)” which seems weird as we try to use core22 here.

If the same configuration was working before, @mr_cal might be interested in investigating this regression. In the meantime, running snapcraft with --destructive-mode inside the container should bypass any attempt to launch a lxd instance.

1 Like

For the docker issue: I agree - to build core22 snaps in docker, use snapcraft --destructive-mode.

it was working fine 3 weeks ago

I backtracked to snapcraft 7.2.0 and 7.0.11 and wasn’t able to build core22 snaps without --destructive-mode.

Second question, lxd with core22 also seems to fail:

Two questions here:

  1. Can you post your snapcraft.yaml? I’d like to see what snaps and packages are listed.

  2. This is running something like snapcraft --use-lxd from your machine? (I want to make sure that docker isn’t involved with this question)

Would it make sense to change snapcraft so that we don’t have to provide --destructive-mode when it’s building in docker (auto detect) ?

Also using https://github.com/snapcore/snapcraft/blob/main/docker/Dockerfile and setting ubuntu=jammy, we still have to include core20 because snapcraft itself uses it.

Separately we are having trouble building Python software because it apparently fails at creating virtual environment when the snap being built sets base: core22 – will create a new thread with something reproducible

Don’t forget, that if you can run your containers with --privileged mode then you can try using the container images that I maintain: