Hi <#C03N1E6HFPY|help> I'm attempting to run <Wi...
# help
a
Hi #help I'm attempting to run Wiremock.net as a docker image so that I can record mappings. Does anyone know how to pass in arguements to set the configuration when the container starts up? This will start the container with proxy disabled
docker run -it --rm -p 9091:80 sheyenrath/wiremock.net
I was expecting to be able to pass in arguments like this to set the configuration settings
--proxy-all="<http://myurl.com|http://myurl.com>" --record-mappings"
b
Probably good to also post this in #wiremock-dotnet ? @Stef Heyenrath might be able to help out there
s
@Alex Hay The supported commandline parameters are listed here: https://github.com/WireMock-Net/WireMock.Net/wiki/WireMock-commandline-parameters It could be that the ones you need are not yet mapped. I will take a look tomorrow.
a
Thanks, I'd not found that page. It does look like the ones I'm after aren't mapped. The use case is basically making it as easy as possible for my team members to quickly spin up a container and record responses from an API for writing tests.
s
In your case, you need to add
--ProxyUrl=<http://myurl.com>"
and
SaveMapping
and
SaveMappingToFile
I did add some extra info on this page... https://github.com/WireMock-Net/WireMock.Net/wiki/WireMock-commandline-parameters
🙂 1
a
Thank you Stef
s
a
Perhaps I am missing something simple but running the container with this exact command returns "No matching mapping found" when visiting any URL. It also stops the default debug logs of server settings and request responses displaying
docker run -it --rm -p 9091:80 sheyenrath/wiremock.net --ProxyUrl="<https://www.bbc.co.uk|https://www.bbc.co.uk>" --SaveMapping --SaveMappingToFile
Viewing
__admin/settings
shows the same settings as starting the container without any additional parameters. No proxy settings defined.
It seems that none of the listed command line arguments I try change the admin settings e.g.
--AllowPartialMapping
s
I'm sorry, I provided the wrong command line. It should be:
docker run -it --rm -p 9091:80 sheyenrath/wiremock.net --ProxyUrl <https://www.bbc.co.uk> --SaveMapping true -SaveMappingToFile true
a
Ahh, I see no
=
after that arguments. That works now, thanks 🙂
👍 1