How to debug docker plugin in IDE (golang)
- Follow the normal process to create a docker plugin
- Get the plugin id, docker plugin ls, such as bf4371658b84c1b76933cb358ce8bd3cd895c94d47e645d5166b084e373d8aab
docker plugin disable ${plugin_name}
mkdir -p /run/docker/plugins/bf4371658b84c1b76933cb358ce8bd3cd895c94d47e645d5166b084e373d8aab
- Set the socketAddress address in the code as:
socketAddress=/run/docker/plugins/bf4371658b84c1b76933cb358ce8bd3cd895c94d47e645d5166b084e373d8aab/${plugin_name}.sock
- Just start DEBUG in IDE
The plug-in tested in the project, the project contains the plug-in installation method:
https://github.com/ishantt/docker-ipam-plugin/