Skip to content

Sources for Snapcraft as OCI images, maintained by the Starcraft team

License

Notifications You must be signed in to change notification settings

canonical/snapcraft-rocks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Snapcraft rocks

This repository contains Snapcraft rocks and the sources to generate them. The rocks are OCI-compliant container images that run different versions of Snapcraft to create snaps.

Each rock in this repository bundles a specific version of Snapcraft, targeting snaps for a specific core. The currently supported versions and cores have the following tags:

  • 7_core22, bundling the latest Snapcraft 7 capable of building core22 snaps.
  • 8_core22, bundling the latest Snapcraft 8 capable of building core22 snaps.
  • 8_core24, bundling the latest Snapcraft 8 capable of building core24 snaps.

Usage

The contained Snapcraft needs access to the directory containing the project that you want to snap (the directory containing the snap folder with a snapcraft.yaml file), and this directory needs to be exposed to the running container as /project. For example, the following command will mount the current directory into a new container and run pack on the latest version of Snapcraft 7 for core22 snaps:

docker run -it -v `pwd`:/project ghcr.io/canonical/snapcraft:7_core22 pack

Other commands, like clean or build, can be called simply by replacing pack in the example above. Every argument provided after the image name is forwarded to Snapcraft.

Reporting bugs

Please report all issues, improvements and feature requests at https://github.com/canonical/snapcraft-rocks.

Development

The sources in this repository are capable of building different versions of Snapcraft, targeting snaps for different cores. The sources are separated into Git branches in the form coreX-Y, where X is a core number (like 22 or 24), and Y is a major version of Snapcraft (like 7 or 8).

For example, branch core22-7 contains the Rockcraft project to create a rock containing the latest stable version of Snapcraft 7 and can be used to create snaps targetting core22.

Supported versions

These are the currently supported combinations of Snapcraft versions and cores:

  • Branch core22-7, for rocks with latest Snapcraft 7 to build core22 snaps.
  • Branch core22-8, for rocks with latest Snapcraft 8 to build core22 snaps.
  • Branch core24-8, for rocks with latest Snapcraft 8 to build core24 snaps.

Requirements

  • Rockcraft is needed to generate the rocks (minimum version 1.1.0).
  • Docker or some other engine is needed to create containers from the images. Note: Docker can sometimes make iptables changes that break LXD instances used by Rockcraft. See this page for details.

Instructions

  • First, choose a target Snapcraft version and core and checkout the appropriate branch. As an example, let's use branch core22-7.
  • Run rockcraft pack to create a rock whose name starts with snapcraft-core22_7. The remainder of the name depends on the actual full version of Snapcraft and the host architecture. For example, running this command on an amd64 machine when 7.5.4 is the latest stable Snapcraft 7 version will yield a rock called snapcraft-core22_7.5.4_amd64.rock.
  • Use a tool like Skopeo to convert and load the rock into Docker's local registry. You can use the skopeo binary included in Rockcraft's snap for this (see the instructions on Rockcraft's docs).
  • Finally, use Docker to create containers to run Snapcraft as described in the Usage section above.

About

Sources for Snapcraft as OCI images, maintained by the Starcraft team

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages