mkdir -p /opt/mock/mappings
docker run -d --name wiremock -v /opt/mock/mappings:/home/wiremock/mappings -p 9999:8080 nhzdevops/restmock:1.0.1
目录结构
./ ├── docker-compose.yml └── mappings └── users.json
json 范例 访问 http://localhost:9999/users
{ "request": { "method": "GET", "url": "/users" }, "response": { "status": 200, "jsonBody": [ { "name":"dalong", "appversion":"v1" }, { "name":"login", "appversion":"v1" }, { "name":"user", "appversion":"v1" } ], "headers": { "Content-Type": "application/json" } } }