sashokbg opened a new issue, #403:
URL: https://github.com/apache/apisix-docker/issues/403

   Hello,
   
   I am unable to find out how to run external plugins on the docker image.
   I followed the apisix documentation at 
https://apisix.apache.org/docs/apisix/external-plugin/.
   
   What I have tried:
   - I compiled the test plugin at 
https://github.com/tzssangglass/java-plugin-runner-demo-1
   - I mounted it in the container
   ```
       # docker-compouse file
       volumes:
         - error_vol:/usr/local/apisix/logs
         - ./apisix_conf/config.yaml:/usr/local/apisix/conf/apisix.yaml
         - ./plugins/demo-0.0.1-SNAPSHOT.jar:/plugins/plugin.jar
   ```
   
   - I added the following to the config.yaml
   
   ```
   ext-plugin:
     cmd: ["java", "-jar", "/plugins/plugin.jar"]
   
   upstreams:
     -
       id: 1
       nodes:
         "127.0.0.1:8080": 1
       type: roundrobin
   
   routes:
     - uri: /get
       upstream_id: 1
       plugins:
         ext-plugin-pre-req:
           conf:
             - name: "DemoFilter"
               value: "{\"enable\":\"feature\"}"}
   
   ```
   
   - Then I test 
   
   `curl http://127.0.0.1:9080/get -iv`
   
   - The logs I see mention a socket missing
   
   ```
   apache-apisix                     | 2023/01/09 09:09:22 [crit] 38#38: *78476 
connect() to unix:/usr/local/apisix/conf/apisix-1.sock failed (2: No such file 
or directory), client: 127.0.0.1, server: _, request: "GET /get HTTP/1.1", 
host: "127.0.0.1:9080"
   apache-apisix                     | 2023/01/09 09:09:22 [error] 38#38: 
*78476 [lua] init.lua:883: phase_func(): failed to connect to the unix socket 
unix:/usr/local/apisix/conf/apisix-1.sock: no such file or directory, client: 
127.0.0.1, server: _, request: "GET /get HTTP/1.1", host: "127.0.0.1:9080"
   apache-apisix                     | 2023/01/09 09:09:22 [warn] 38#38: *78476 
[lua] plugin.lua:1098: run_plugin(): ext-plugin-pre-req exits with http status 
code 503, client: 127.0.0.1, server: _, request: "GET /get HTTP/1.1", host: 
"127.0.0.1:9080"
   apache-apisix                     | 127.0.0.1 - - [09/Jan/2023:09:09:22 
+0000] 127.0.0.1:9080 "GET /get HTTP/1.1" 503 269 0.000 "-" "curl/7.87.0" - - - 
"http://127.0.0.1:9080";
   ```
   
   My assumption:
   
   - It seems the docker image *apache/apisix:latest* is missing java as a 
dependency ?
   - I am running in standalone mode and apisix is automatically in "external 
plugin debug" mode ?
   
   Any help is greatly appreciated !
   Thank you for your time
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to