action-build icon indicating copy to clipboard operation
action-build copied to clipboard

Use the official Docker image

Open abitrolly opened this issue 11 months ago • 5 comments

There is an official Docker image for snapcraft https://snapcraft.io/docs/snapcraft-docker-images

Using it as an official docker container action will make the image more maintainable and will allow to build snaps on open source CI systems, such as GitLab.

abitrolly avatar Jul 24 '23 05:07 abitrolly

I am doing some maintenance fixes to it https://github.com/snapcore/snapcraft/pull/4290 but I am unemployed and my abilities are limited.

abitrolly avatar Jul 24 '23 05:07 abitrolly

I'm not sure how that would help. As written, the aim of the action is to build the snap in the environment it is intended to be built in. To build a snap with Docker, you need to pick an image that matches the snap (e.g. an Ubuntu 20.04 image to build core20 based snaps, an Ubuntu 22.04 image to build core22 based snaps, etc).

If this was a docker action, we'd need different versions of the action to support each base, and detect if people were using the wrong version of the action. That seems worse.

As far as Gitlab and other CI systems go, I'd expect any common functionality to exist in Snapcraft itself. As it stands, this action just contains what's needed to get Snapcraft up and running on Github's runners. What would you expect to reuse from this action in other CI systems?

jhenstridge avatar Oct 24 '23 02:10 jhenstridge

Docker images can be cached, so they should init and run faster, saving time and compute credits.

I was not really aware that GitHub Actions don't allow to select Docker image dynamically. Or call another image from an image.

abitrolly avatar Oct 24 '23 05:10 abitrolly

I needed Docker, because snapcraft doesn't work on Fedora. Some SELinux issues, I don't know.

abitrolly avatar Oct 24 '23 05:10 abitrolly

If you've got issues with Snapcraft itself, I suggest filing an issue at https://github.com/snapcore/snapcraft/issues.

This is just the glue code to run Snapcraft on the Github Actions runners. It has nothing to do with running Snapcraft locally or on different CI systems. Anything shared between those environments should be happening in Snapcraft so everyone benefits.

jhenstridge avatar Oct 27 '23 12:10 jhenstridge