github.com/khulnasoft/cli@v0.0.0-20240402070845-01bcad7beefa/docs/reference/commandline/plugin_create.md (about)

     1  # plugin create
     2  
     3  <!---MARKER_GEN_START-->
     4  Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory.
     5  
     6  ### Options
     7  
     8  | Name         | Type | Default | Description                     |
     9  |:-------------|:-----|:--------|:--------------------------------|
    10  | `--compress` |      |         | Compress the context using gzip |
    11  
    12  
    13  <!---MARKER_GEN_END-->
    14  
    15  ## Description
    16  
    17  Creates a plugin. Before creating the plugin, prepare the plugin's root
    18  filesystem as well as the [config.json](https://docs.docker.com/engine/extend/config/).
    19  
    20  ## Examples
    21  
    22  The following example shows how to create a sample `plugin`.
    23  
    24  ```console
    25  $ ls -ls /home/pluginDir
    26  
    27  total 4
    28  4 -rw-r--r--  1 root root 431 Nov  7 01:40 config.json
    29  0 drwxr-xr-x 19 root root 420 Nov  7 01:40 rootfs
    30  
    31  $ docker plugin create plugin /home/pluginDir
    32  
    33  plugin
    34  
    35  $ docker plugin ls
    36  
    37  ID              NAME            DESCRIPTION                  ENABLED
    38  672d8144ec02    plugin:latest   A sample plugin for Docker   false
    39  ```
    40  
    41  The plugin can subsequently be enabled for local use or pushed to the public registry.
    42  
    43  ## Related commands
    44  
    45  * [plugin disable](plugin_disable.md)
    46  * [plugin enable](plugin_enable.md)
    47  * [plugin inspect](plugin_inspect.md)
    48  * [plugin install](plugin_install.md)
    49  * [plugin ls](plugin_ls.md)
    50  * [plugin push](plugin_push.md)
    51  * [plugin rm](plugin_rm.md)
    52  * [plugin set](plugin_set.md)
    53  * [plugin upgrade](plugin_upgrade.md)