Snapcraft in docker for snapcraft > 7?

Hey there,

Is it correct that the docker referenced in this article is not functional anymore? I am guessing it was made for an older snapcraft version without forward compatibility.

I would like to build my snaps in our CI pipelines, for which I need snapcraft functional in a docker container…

I have tried building the default and with risk 7.x/stable, neither work.

I call like

docker run -v "$PWD":/build -w /build snap-builder snapcraft --destructive-mode

But get the following error:

Starting Snapcraft 7.5.4
Logging execution to '/root/.local/state/snapcraft/log/snapcraft-20240215-212721.968615.log'
Running on amd64 for amd64
Initializing parts lifecycle
Executing parts lifecycle...
Failed to pull source: unable to determine source type of '/snap/snapcraft/current/usr/share/snapcraft/extensions/desktop/command-chain'.
Full execution log: '/root/.local/state/snapcraft/log/snapcraft-20240215-212721.968615.log'

Is it true that it is not possible, like the last comment in this post is suggesting?

The only viable way to build in a continuous way is the build service now. This is bad news for anyone who wants to publish a proprietary snap.

Hi @Charlee, I haven’t seen this error before. I tried building the Docker image and I’m now getting a different error (Warning: Failed to create the file snapcraft.snap: Permission denied). How are you building the Docker image?

On the other hand, Snapcraft is moving away from the Dockerfile in favor of Snapcraft rocks.

1 Like