Create a simple extension (original) (raw)
To start creating your extension, you first need a directory with files which range from the extension’s source code to the required extension-specific files. This page provides information on how to set up a minimal frontend extension based on plain HTML.
Before you start, make sure you have installed the latest version ofDocker Desktop.
Tip
If you want to start a codebase for your new extension, our Quickstart guide and
docker extension init <my-extension>
provides a better base for your extension.
In the minimal-frontend
sample folder, you can find a ready-to-go example that represents a UI Extension built on HTML. We will go through this code example in this tutorial.
Although you can start from an empty directory, it is highly recommended that you start from the template below and change it accordingly to suit your needs.
- Contains everything required to build the extension and run it in Docker Desktop.
- A file that provides information about the extension such as the name, description, and version.
- The source folder that contains all your HTML, CSS and JS files. There can also be other static assets such as logos and icons. For more information and guidelines on building the UI, see the Design and UI styling section.
At a minimum, your Dockerfile needs:
- Labels which provide extra information about the extension, icon and screenshots.
- The source code which in this case is an
index.html
that sits within theui
folder. - The
metadata.json
file.
A metadata.json
file is required at the root of the image filesystem.
For more information on the metadata.json
, see Metadata.
Now that you have configured the extension, you need to build the extension image that Docker Desktop will use to install it.
This built an image tagged awesome-inc/my-extension:latest
, you can run docker inspect awesome-inc/my-extension:latest
to see more details about it.
Finally, you can install the extension and see it appearing in the Docker Desktop Dashboard.
To preview the extension in Docker Desktop, close and open the Docker Desktop Dashboard once the installation is complete.
The left-hand menu displays a new tab with the name of your extension.
- Build a more advanced frontend extension.
- Learn how to test and debug your extension.
- Learn how to setup CI for your extension.
- Learn more about extensions architecture.