The top-level keys and values in snapcraft.yaml provide the snap build process, and the store, with the overarching details of a snap.
See Snapcraft app metadata and Snapcraft parts metadata for details on how apps and parts are configured within snapcraft.yaml.
Top-level details include a snap’s name, version and description, alongside operational values such as its confinement level and supported architecture.
Type: string
(optional)
Incorporate external metadata via the referenced part.
See Using external metadata for more details.
Type: list[object]
(optional)
List of build and run architectures.
For more details, see Architectures.
Type: list[string]
(optional)
A list of features that must be supported by the core in order for this snap to install. For example to make the snap only installable on certain recent version of snapd(like 2.38) you can specify:
assumes:
- snapd2.38
Some other values for specific features also exist, refer the featureSet list in overlord/snapstate/check_snap.go: https://github.com/snapcore/snapd/blob/master/overlord/snapstate/check_snap.go#L39
Type: string
(optional)
A snap of type base
to be used as the execution environment for this snap. See Base snaps for further details.
Values:
bare |
Empty base snap, useful for testing and fully statically linked snaps (e.g. busybox-static ) (not yet supported) |
core18 |
Ubuntu Core 18 |
core |
Ubuntu Core 16 |
Type: enum
(optional)
Determines if the snap should be restricted in access or not.
Possible values are strict
(for no access outside of declared interfaces
through plugs
), devmode
(for unrestricted access) or classic
. For more information, refer to Confinement.
Examples: strict
, or devmode
Type: string
(mandatory)
Multi-line description of the snap.
A more in-depth look at what your snap does and who may find it most useful.
Type: enum
(optional)
Defines the quality grade
of the snap.
Can be either devel
(i.e. a development version of the snap, so not to be published to the stable
or candidate
channels) or stable
(i.e. a stable release or release candidate, which can be released to all channels).
Example: [stable
or devel
]
Type: string
(optional)
Path to icon image that represents the snap in the snapcraft.io store pages and other graphical store fronts.
Note that the desktop menu does not use this icon. It uses the icon in the .desktop
file of the application.
It is a relative path to a .png
/.svg
file from the source tree root. The recommended size is 256x256 pixels. Aspect ratio needs to be 1:1. Image size can vary from 40x40 to 512x512 px and the file size should not be larger than 256 KB.
Examples: _package_name_.svg
, or snap/gui/logo.png
Type: string
(optional)
A license for the snap in the form of an SPDX expression for the license.
In the legacy Snapcraft syntax (not using the base
key), this key is only available through the passthrough
key.
Currently, only SPDX 2.1 expressions are supported, refer snapd/licenses.go at master · snapcore/snapd for accepted expressions.
Examples: GPL-3.0
, MIT
, Proprietary
Type: string
(mandatory)
The identifying name of the snap.
It must start with an ASCII character and can only contain letters in lower case, numbers, and hyphens, and it can’t start or end with a hyphen. The name must be unique if you want to publish to the Snap Store.
For help on choosing a name and registering it on the Snap Store, see Registering your app name.
Example: my-awesome-app
Type: type[object]
(optional)
Attributes to passthrough to snap.yaml
without validation from snapcraft.
See Using development features in snapcraft for more details.
Type: string
(mandatory)
Sentence summarising the snap.
Max len. 78 characters, describing the snap in short and simple terms.
Example: The super cat generator
Type: string
(optional)
The canonical title of the application, displayed in the software centre graphical frontends.
Max length 40 characters.
In the legacy Snapcraft syntax (not using the base
key), this key is only available through the passthrough
key.
Example: My Awesome Application
Type: enum
(optional)
The type of snap, implicitly set to app
if not set.
For more details, see: gadget, kernel, base.
Example: [app|core|gadget|kernel|base]
Type: string
(mandatory)
A user facing version to display.
Max len. 32 chars. Needs to be wrapped with single-quotes when the value will be interpreted by the YAML parser as non-string.
Examples: '1'
, '1.2'
, '1.2.3'
, git
(will be replaced by a git describe
based version string)
Plugs and slots for an interface are usually configured per-app or per-daemon within snapcraft.yaml. See Snapcraft app metadata for more details. However, snapcraft.yaml
also enables global plugs and slots configuration for an entire snap:
Type: dict
(optional)
These plugs apply to all apps
and differs from apps.<app-name>.plugs
in that the type is in a dict
rather than a list
format, :
(colon) must be postfixed to the interface name and shouldn’t start with -
(dash-space).
Type: dict
(optional)
A set of attributes for a plug.
Example: read
attribute for the home
interface.
Type: string
(optional)
Value of the attribute.
Example: all
for read
attribute of the home
interface.
Type: dict
(optional)
A set of slots that the snap provides, applied to all the apps
.
Type: dict
(optional)
A set of attributes of the slot.
Type: dict
(optional)
Value of the attribute.
Last updated 2 months ago. Help improve this document in the forum.