How to include extra files in a charm

To add extra configuration files and/or binaries/libraries in your charm (e.g., to support more functions), in your charmcraft.yaml, under the parts key, define a part and, in the part properties, set the plugin key to dump or nil. For example:

parts:
  libs:
    plugin: dump
    source: /usr/local/lib/
    organize:
      "libxxx.so*": lib/
    prime:
      - lib/

This libs part will copy the locally built libxxx to the charm lib directory.

If your charm currently uses the prime key to include extra files:

Note that, starting with Charmcraft 3.0, this key will become obsolete and you will see lint errors indicating that unknown additional files have been added.

Users can still use this method to filter existing files.

See more: File charmcraft.yaml > parts


Contributors: @lengau, @syu-w , @tmihoc

Last updated a month ago. Help improve this document in the forum.