Skip to content

Initial setup

Robin Doer edited this page May 17, 2024 · 1 revision

Before version 0.6.0, the nuts tool compiled its plugin permanently. It couldn't be changed. With version 0.6.0 the nuts tool uses a plugin system. Different backends can be used with the tool. A backend plugin is a binary file that needs to be built additionally. Next, it needs to be configured for nuts and attached to a container.

In this example we use the nuts-directory plugin. It is included with the nuts project and has also been used in versions < 0.6.0. This means that all existing containers can still be used.

1.1 Install the required binaries

Here we simply use cargo install to install the nuts tool and the nuts-directory plugin.

cargo install nuts-tool
cargo install nuts-directory --features=plugin

For the nuts-directory crate, the plugin feature must be activated in order for the plugin to be activated.

1.2 Use nuts from Docker

There is a Docker image that can be used to try out nuts. Details can be found here.

2. Configure the nuts-directory plugin

The plugin must be configured for the nuts tool:

nuts plugin add directory --path nuts-directory
  • Here directory is the name of the plugin. You can this identifier to identify the plugin.
  • nuts-directory is the path to the executable file previously installed.

3.1 Create a container

When creating a container, you have to specify the plugin:

nuts container create sample --plugin=directory

This creates a container with the name sample, which uses the directory plugin.

3.2 Prepare an existing container

Containers created before version 0.6.0 can easily be connected to the plugin system.

NUTS_CONTAINER=sample nuts container attach directory

This command attaches the directory plugin to the sample container.

Clone this wiki locally