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

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.

Last updated 29 days ago. Help improve this document in the forum.