Docker-插件激活失败

嗨,我创build了authzdocker插件,但它的Plugin.Activate API失败,当我试图激活它, dockerd --authorization-plugin=docker_plugin1

错误:

 Error validating authorization plugin: legacy plugin: Plugin.Activate: <!doctype html><html lang="en"><head> <title>HTTP Status 404 – Not Found</title><SOME HTML TAGS></b> The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.</p><hr class="line" /><h3>Apache Tomcat/8.5.23</h3></body></html> 

但是我成功地能够通过curl访问这个API。

我的docker_plugin1.json spec文件:

 {"Name": "docker_plugin1", "Addr": "http://localhost:8080/docker_plugin1/"} 

API:

 @POST @Path("Plugin.Activate") @Consumes(MediaType.APPLICATION_JSON) @Produces( MediaType.APPLICATION_JSON) public Response activatePluginRequest(@Context HttpServletRequest httpServletRequest) throws IOException { PluginActivationResponse res = new PluginActivationResponse(); res.Implements = new ArrayList<String>(); res.Implements.add("authz"); return Response.status(200).entity(res).build(); } 

web.xml中:

 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"> <display-name>docker_plugin1</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>Jersey REST Service</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value>com.intel.service</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Jersey REST Service</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>