Jump to content

Recommended Posts

Docker Engine plugins are extensions that add extra functionality to Docker Engine. They can be installed, managed, and removed using Docker CLI. They are developed using different programming languages and frameworks, including C++, Go, Python, etc. There are several types of Docker Engine plugins, such as volume plugins, authorization plugins, network plugins, and logging plugins.

This article will illustrate how to use Docker Engine plugins.

How to Use Docker Engine Plugins?

The Docker Engine plugins can be used in different ways, such as:

Install Docker Plugin

To install a Docker plugin, first, choose a particular plugin on Docker Hub and copy its “pull” command. Then, execute the “docker plugin install <plugin-name>” command in the terminal to install it. The step-by-step procedure to install the Docker plugin is mentioned below:

Step 1: Search for Plugins

On Docker Hub, navigate to the “Explore” page, and choose the “Plugins” option:

Docker-Engine-Plugins-1.png

Upon doing so, you will see all the available plugins. Then, select the desired plugin. For instance, select the “vieux/sshfs” plugin.

Step 2: Copy the “pull” Command
After choosing the desired Plugin, it will open up. Copy its below highlighted “pull” command:
Docker-Engine-Plugins-2.png

Step 3: Install Plugin
Now, run the copied command in the Windows terminal to install the selected plugin:

docker plugin install vieux/sshfs

Docker-Engine-Plugins-3.png

The above output indicates that the “vieux/sshfs” plugin has been installed successfully.

List Docker Plugin

To list the available plugins in the local repository, type out the provided command:

docker plugin ls

Docker-Engine-Plugins-4.png

According to the above image, there is only one plugin installed i.e., “vieux/sshfs”.

Inspect Docker Plugin

Users can inspect the particular plugin using the “docker inspect <plugin-name/ID> command:

docker inspect 11cd68d462ad

Docker-Engine-Plugins-5.png

The above-listed command has displayed detailed information including status, associated containers and volumes, etc., about a plugin with ID “11cd68d462ad”.

Create Volume Using Plugin

Run the “docker volume create -d <plugin-name> –name <volume-name> -o sshcmd=user@<host>:<path>” command to create a new volume using the particular plugin:

docker volume create -d vieux/sshfs --name sshfsVol -o sshcmd=user@1.2.3.4:/remote

Here:

  • The “-d” option is used to specify the volume driver to use. In our case, it is the “vieux/sshfs” plugin.
  • –name” is utilized to specify the volume name. For instance, specify the “sshfsVol” volume name.
  • -o sshcmd=user@1.2.3.4:/remote” specifies the SSH command to connect to the remote host and mount the file system:

Docker-Engine-Plugins-6.png

Verify the created volume using the provided command:

docker volume ls

Docker-Engine-Plugins-7.png

The above-highlighted part shows the newly created volume i.e., “sshfsVol” along with the plugin name.

Enable and Disable Plugin

In this section, users can enable and disable the Docker plugin and can verify the status by following the below process:

Enable Docker Plugin

To enable the Docker plugin, utilize the “docker plugin enable <plugin-name/ID>” command:

docker plugin enable vieux/sshfs

Docker-Engine-Plugins-8.png

Then, view its status using the provided command:

docker plugin ls

Docker-Engine-Plugins-9.png

In the above screenshot, the status of the desired plugin is “true” which indicates that it has been enabled successfully.

Disable Docker Plugin

To disable the Docker plugin, use the “docker plugin disable <plugin-name/ID>” command:

docker plugin disable vieux/sshfs

Docker-Engine-Plugins-10.png

Then, use the following command to ensure whether the plugin has been disabled:

docker plugin ls

Docker-Engine-Plugins-11.png

The status of the plugin is “false” which means it has been disabled successfully.

Remove Docker Plugin

To remove the specific plugin, utilize the “docker plugin rm” command along with the plugin’s name or ID:

docker plugin rm vieux/sshfs

Docker-Engine-Plugins-12.png

Next, verify whether the plugin has been removed or not by listing all plugins:

docker plugin ls

Docker-Engine-Plugins-13.png

In the above image, no plugin can be seen which indicates that the desired plugin has been deleted successfully.

Conclusion

The Docker Engine plugins can be used in different ways, such as installing a particular plugin, listing all plugins, and inspecting a specific plugin. Moreover, users can create a volume using any plugin, enable or disable plugins, and remove Docker plugins. This article has illustrated the usage of Docker Engine plugins with practical implementation.

View the full article

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...