A base snap is a special kind of snap that provides a run-time environment with a minimal set of libraries that are common to most applications. They’re transparent to users, but they need to be considered, and specified, when building a snap.
Bases are defined by adding the
base: keyword to a snap’s snapcraft.yaml followed by the base name.
There are currently two supported bases:
core18: the current standard base for snap building, based on Ubuntu 18.04 LTS
core: also known as core 16, and based on Ubuntu 16.04 LTS
For example, to specify core 18, use the following:
To specify core 16, use the following
The base snap mounts itself as the root filesystem within your snap such that when your application runs, the base’s library paths are searched directly after the paths for your specific snap.
When building your snap with no specified base, Snapcraft will operate in legacy mode. This is essentially a prior (2.43-era) version of Snapcraft, and will lose the functionalities and bug fixes introduced in the new version.
Building a base snap
While it is possible to build your own base snap, its publisher needs to take responsibility for its maintenance and updates. In particular:
- bases need to be built from stable packages
- ABI compatibility cannot broken (ie. never replace symbols or libraries, and be strict)
- security updates must be pro-active
Base snaps can be either bootable or non-bootable. The former needs to include systemd while the latter can be leaner.
Last updated 2 months ago. Help improve this document in the forum.