Closed adilfulara closed 7 years ago
Override the default command to add your binded jar to the java classpath :
docker run -d -v $PWD/extensions/your-extension.jar:/your-extension.jar rodolpheche/wiremock java -cp "/your-extension.jar:/wiremock-standalone.jar" com.github.tomakehurst.wiremock.standalone.WireMockServerRunner --extensions your.applicaton.extension.Transformer
Did you successfully run wiremock with extension using the command above?
sorry I didn't. I actually packaged my extensions with wiremock based so that i could use it elsewhere without volume mounts. but i did exactly what you recommended :)
java -cp "/home/*" "com.github.tomakehurst.wiremock.standalone.WireMockServerRunner" --extensions co.foo.MyExtensions
I made it easier to use with the latest image.
Now, the default command automatically includes a specific folder (/var/wiremock/extensions) in the java classpath. You just have to copy/bind your extension jar into this folder and run the container with --extensions co.foo.MyExtensions
I wrote an example on how to do here : https://github.com/rodolpheche/wiremock-docker#use-wiremock-extensions
Did you try with the latest image ?
How does one use wiremock extensions with this image? If i mount a volume with the extensions jar how would the docker image pick it up ?