github.com/sld880311/docker@v0.0.0-20200524143708-d5593973a475/docs/reference/commandline/plugin_create.md (about)

     1  ---
     2  title: "plugin create"
     3  description: "the plugin create command description and usage"
     4  keywords: "plugin, create"
     5  ---
     6  
     7  <!-- This file is maintained within the docker/docker Github
     8       repository at https://github.com/docker/docker/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # plugin create
    17  
    18  ```markdown
    19  Usage:  docker plugin create [OPTIONS] PLUGIN PLUGIN-DATA-DIR
    20  
    21  Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory.
    22  
    23  Options:
    24        --compress   Compress the context using gzip
    25        --help       Print usage
    26  ```
    27  
    28  ## Description
    29  
    30  Creates a plugin. Before creating the plugin, prepare the plugin's root filesystem as well as
    31  [the config.json](../../extend/config.md)
    32  
    33  ## Examples
    34  
    35  The following example shows how to create a sample `plugin`.
    36  
    37  ```bash
    38  $ ls -ls /home/pluginDir
    39  
    40  4 -rw-r--r--  1 root root 431 Nov  7 01:40 config.json
    41  0 drwxr-xr-x 19 root root 420 Nov  7 01:40 rootfs
    42  
    43  $ docker plugin create plugin /home/pluginDir
    44  
    45  plugin
    46  
    47  $ docker plugin ls
    48  
    49  ID                  NAME                TAG                 DESCRIPTION                  ENABLED
    50  672d8144ec02        plugin              latest              A sample plugin for Docker   false
    51  ```
    52  
    53  The plugin can subsequently be enabled for local use or pushed to the public registry.
    54  
    55  ## Related commands
    56  
    57  * [plugin disable](plugin_disable.md)
    58  * [plugin enable](plugin_enable.md)
    59  * [plugin inspect](plugin_inspect.md)
    60  * [plugin install](plugin_install.md)
    61  * [plugin ls](plugin_ls.md)
    62  * [plugin push](plugin_push.md)
    63  * [plugin rm](plugin_rm.md)
    64  * [plugin set](plugin_set.md)
    65  * [plugin upgrade](plugin_upgrade.md)