Core Runner configuration
These environment variables control the fundamental behavior of the WireMock Runner.WMC_RUNNER_ENABLED
Enables Runner mode when using the WireMock binary. By default, the binary runs the CLI tool, but setting this variable totrue will execute the Runner instead.
Type: Boolean
Default: false
Example:
You should never need to set this variable yourself except when building your own Docker image to wrap WireMock Runner.This can be safely ignored if using WireMock’s official Docker image.
WMC_DEFAULT_MODE
The mode that the Runner starts in. Once running, the mode can be changed via the HTTP switch endpoint. Type: String Valid values:record-many, serve
Default: serve
Example:
WMC_ADMIN_PORT
The port that the Runner’s admin interface is exposed on. The admin interface provides endpoints for switching modes and flushing recordings. Type: Integer Default: Random available port Example:WMC_API_TOKEN
The API token used to authenticate with WireMock Cloud. This token is required for operations that interact with WireMock Cloud, such as flushing recordings inrecord-many mode or pulling stub mappings.
Type: String
Required: Yes
Example:
You can find your API token in the WireMock Cloud console or by running
wiremock config get api-token if you’ve logged in via the CLI.Configuration file location
WMC_VALUES_CONFIG_FILE
Overrides the default path for the values configuration file. By default, the Runner looks for.wiremock/config.yaml in the working directory.
Type: String (file path)
Default: .wiremock/config.yaml
Example:
Setting the
--wiremock-dir option does not affect where the CLI/Runner searches for the default values file. Use WMC_VALUES_CONFIG_FILE to specify a custom location.Mode-specific configuration
The Runner supports the same configuration options as the WireMock CLI for its respective modes. You can set any CLI option using environment variables following the patternWMC_<MODE_NAME>_<OPTION_NAME>.
Pattern for mode-specific variables
Environment variable names follow this pattern:- Prefix:
WMC_ - Mode name:
RUN_(for serve mode) orRECORD_MANY_(for record-many mode) - Option name: The CLI option name with dashes replaced by underscores
Examples
Serve mode configuration
Forserve mode, equivalent to the run CLI command:
Record-many mode configuration
Forrecord-many mode, equivalent to the record-many CLI command:
Profile configuration via mode-specific variables
Profiles define which Mock APIs in WireMock Cloud are mapped to which local services. These environment variables allow you to specify which profile to use for different Runner modes.WMC_RUN_PROFILE
Specifies the profile to use when the Runner is inserve mode. This determines which Mock APIs are served and on which ports.
Type: String
Default: default profile from wiremock.yaml
Example:
WMC_RECORD_MANY_PROFILE
Specifies the profile to use when the Runner is inrecord-many mode. This determines which services are recorded and which Mock APIs in WireMock Cloud receive the recorded stubs.
Type: String
Default: default profile from wiremock.yaml
Example:
Available options
For a complete list of available options for each mode, see:- Local playback (
run) options forservemode - Multi-domain recording (
record-many) options forrecord-manymode
Configuration precedence
When the same option is configured in multiple places, the following precedence order applies (highest to lowest):- HTTP request body (when switching modes via the switch endpoint)
- Environment variables
- Values file (
.wiremock/config.yaml) - Default values
See also
- Runner overview - General information about the WireMock Runner
- CLI configuration - Details on CLI environment variable patterns
- Serve mode - Using the Runner in serve mode
- Record-many mode - Using the Runner in record-many mode