This template provides a minimal template on how to build a Podman Desktop extension. More information can be found on our official extension documentation on how to further expand your extension.
With this template, on activating a "Hello World!" dialog will appear.
To build and develop the extension, follow these steps:
- Clone the project or your fork:
$ git clone https://github.com/containers/podman-desktop-extension-minimal-template/
- Run
npm install
to install all relevant packages:
$ npm install
- Create a build:
Creating a build will generate all required files for Podman Desktop to load the extension:
$ npm run build
Optionally, you can also use npm run watch
to continuously rebuild after each change, without needing to re-run npm run build
:
$ npm run watch
- Load the extension temporarily within Podman Desktop:
We will load the extension within Podman Desktop to test it. This requires cloning the Podman Desktop repo:
$ git clone https://github.com/containers/podman-desktop
Navigate to the directory:
$ cd podman-desktop
Run the npm install
command:
$ npm install
Load the extension using the npm run watch
command with an additional parameter to load the backend
packaged data:
npm run watch --extension-folder ../podman-desktop-extension-minimal-template
- Confirm that the extension has been loaded:
You can now see that your extension has been loaded by checking the Extensions section of Podman Desktop:
A "Hello World" dialog will also appear on each activation:
More information on how to package and publish your extension can be found in our official publishing documentation.
However, we have provided a pre-made Containerfile in this template for you to try.
- Package your extension by building the image:
$ podman build -t quay.io/myusername/myextension .
- Push the extension to an external registry:
$ podman push quay.io/myusername/myextension
- Install via the Podman Desktop "Install Custom..." button: