I’m trying to build a custom image that contains some local snaps.
I know I can add local snaps to the image during the “imaging” stage via $ ubuntu-image snap my-model.model --snap ./my_snap.snap but I was wondering if it is possible to add local snaps via the model assertion.
From what I see in the model assertion documentation it should be possible to add “local” snaps this way, though it doesn’t go into detail. The relevant section (emphasis mine):
id (optional): id of the snap if assigned by a store. Must be omitted for **local** snaps.
Am I barking up the wrong tree here or is it possible?
Ah,
slight issue. If I sumply skip the id": "<snap-id> part, I am unable to sign and create the image…
The error I am getting is:
$ cat model.assertion.json | sudo snap sign -k key > signed.model error: cannot assemble assertion model: "id" of snap "my-local-snap" is mandatory for signed grade model
The definition of the local snap which I am trying to test in the image (in the image json file):