The snapcraft format


The snapcraft.yaml file is the main entry point to create a snap through Snapcraft. It contains all the details the snapcraft command needs to build a snap.

In general, snapcraft.yaml can be organised into three principle sections:

1. top-level metadata, containing values, such as name, typically used by the store:

name: hello
base: core18
version: '2.10'
summary: GNU Hello, the "hello world" snap
description: |
  GNU hello prints a friendly greeting.
grade: stable
confinement: strict

2. apps detailing how apps and services are exposed to the host system:

    command: bin/hello

3. and parts to describes how to import, and potentially build, each required part of the snap:

    plugin: autotools

For further details on the metadata contained within each of the above sections, see one of the following:

  1. Snapcraft top-level metadata
  2. Snapcraft parts metadata
  3. Snapcraft app and service metadata

A set of environment variables is also available during the build process. See Environment variables that Snapcraft exposes for further details.

Additionally, see Snapcraft.yaml reference for a complete overview of the metadata supported by snapcraft.yaml, and Snapcraft advanced grammar to learn how to check for specific conditions for certain YAML keys.

Snapcraft advanced grammar
Snapcraft filesets
Snap Documentation
Install single file from stage-packages
Creating a snap
Snapcraft overview
Snapcraft.yaml reference
Supported snap hooks
Using external metadata
Build on Docker

Note that you can, as the last resort, check out the schema in the source tree: snapcraft/snapcraft.json at master ยท snapcore/snapcraft.