{"id":13677445,"url":"https://github.com/wiremock/wiremock-docker","last_synced_at":"2025-05-16T09:05:55.390Z","repository":{"id":40646246,"uuid":"46951244","full_name":"wiremock/wiremock-docker","owner":"wiremock","description":"Wiremock Docker image","archived":false,"fork":false,"pushed_at":"2025-04-22T15:32:48.000Z","size":235,"stargazers_count":226,"open_issues_count":20,"forks_count":105,"subscribers_count":12,"default_branch":"main","last_synced_at":"2025-04-22T16:44:49.990Z","etag":null,"topics":["arm","containers","docker","docker-image","hacktoberfest","wiremock"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/wiremock/wiremock","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wiremock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-11-26T23:55:28.000Z","updated_at":"2025-04-22T15:32:51.000Z","dependencies_parsed_at":"2023-02-10T00:01:01.574Z","dependency_job_id":"d90f1f46-8bde-4d0c-88a4-acc9c2433393","html_url":"https://github.com/wiremock/wiremock-docker","commit_stats":null,"previous_names":[],"tags_count":93,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wiremock%2Fwiremock-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wiremock","download_url":"https://codeload.github.com/wiremock/wiremock-docker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254501557,"owners_count":22081528,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","containers","docker","docker-image","hacktoberfest","wiremock"],"created_at":"2024-08-02T13:00:42.299Z","updated_at":"2025-05-16T09:05:50.380Z","avatar_url":"https://github.com/wiremock.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# WireMock Docker images\n\n[![Main](https://github.com/wiremock/wiremock-docker/actions/workflows/main.yml/badge.svg)](https://github.com/wiremock/wiremock-docker/actions/workflows/main.yml) [![Nightly](https://github.com/wiremock/wiremock-docker/actions/workflows/nightly.yml/badge.svg)](https://github.com/wiremock/wiremock-docker/actions/workflows/nightly.yml) [![Docker Pulls](https://img.shields.io/docker/pulls/wiremock/wiremock.svg)](https://hub.docker.com/r/wiremock/wiremock/)\n[![a](https://img.shields.io/badge/slack-Join%20us-brightgreen?style=flat\u0026logo=slack)](https://slack.wiremock.org/)\n\nThe official Docker image for WireMock Standalone deployments.\nIt includes WireMock for Java under the hood, and fully compatible with its features.\nYou can learn more about WireMock standalone on the\n[WireMock docs site]((http://wiremock.org/docs/standalone)).\n\n## Quick Start\n\nIn a temporary directory, checkout the demo repository,\npull the Docker image,\nand start the WireMock instance.\n\n```shell\ndocker pull wiremock/wiremock:latest\ngit clone https://github.com/wiremock/wiremock-docker.git\ndocker run -it --rm \\\n  -p 8080:8080 \\\n  -v $PWD/wiremock-docker/samples/hello/stubs:/home/wiremock \\\n  wiremock/wiremock:latest\n```\n\nYou will get a CLI output like this one:\n\n```shell\n██     ██ ██ ██████  ███████ ███    ███  ██████   ██████ ██   ██\n██     ██ ██ ██   ██ ██      ████  ████ ██    ██ ██      ██  ██\n██  █  ██ ██ ██████  █████   ██ ████ ██ ██    ██ ██      █████\n██ ███ ██ ██ ██   ██ ██      ██  ██  ██ ██    ██ ██      ██  ██\n ███ ███  ██ ██   ██ ███████ ██      ██  ██████   ██████ ██   ██\n\n----------------------------------------------------------------\n|               Cloud: https://wiremock.io/cloud               |\n|               Slack: https://slack.wiremock.org              |\n----------------------------------------------------------------\n\nport:                         8080\nenable-browser-proxying:      false\nno-request-journal:           false\nverbose:                      false\nextensions:                   response-template,webhook\n```\n\n## Supported architectures\n\n- x64\n- armv7\n- armv8\n\n## Supported tags\n\nThere are multiple image tags provided for end users.\nThese tags are available on DockerHub and GitHub Packages,\nsee the full list [here](https://hub.docker.com/r/wiremock/wiremock/tags/).\nThe most important tags are listed below.\n\n### Latest images\n\n- `3.12.1-1` [(3.12.1-1/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/3.12.1-1/Dockerfile)\n- `3.12.1-1-alpine` [(3.12-alpine/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/3.12.1-1/alpine/Dockerfile)\n- `latest` [(latest/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/latest/Dockerfile)\n- `latest-alpine` [(latest-alpine/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/latest-alpine/Dockerfile)\n- `main` [(main/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/main/Dockerfile)\n- `main-alpine` [(main-alpine/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/main/alpine/Dockerfile)\n\n### Latest WireMock 2.x images\n\n- `2.35.1-1` [(2.35.1-1/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/2.35.1-1/Dockerfile)\n- `2.35.1-1-alpine` [(2.35.1-1-alpine/Dockerfile)](https://github.com/wiremock/wiremock-docker/blob/2.35.1-1/alpine/Dockerfile)\n\n### Deprecated and experimental tags\n\n- `nightly` [(main/Dockerfile-nightly)](https://github.com/wiremock/wiremock-docker/blob/main/Dockerfile-nightly)\n- `nightly-alpine` [(main-alpine/Dockerfile-nightly)](https://github.com/wiremock/wiremock-docker/blob/main/alpine/Dockerfile-nightly)\n- `3x`- Latest WireMock 3.x image, with bundled Java 11 - now `latest`\n- `3x-alpine` - Latest WireMock alpine 3.x image, with bundled Java 11 - now `latest`\n\n## Using WireMock in Docker\n\nTo start WireMock with the default settings:\n\n```sh\ndocker run -it --rm -p 8080:8080 wiremock/wiremock\n```\n\nBy default, the image exposes the 8080 port for HTTP.\nTo verify the WireMock state,\naccess [http://localhost:8080/__admin/health](http://localhost:8080/__admin/health) to display the health status and the information.\nThe `/__admin/health` endpoint is available for WireMock 3.1.0 or above.\n\nA [HEALTHCHECK](https://docs.docker.com/reference/dockerfile/#healthcheck) is also built into the docker image to\nallow direct querying of the docker container's health status.\nUnder the hood, this uses the same method as above to verify the status of the container.\n\n## Configuring WireMock\n\nYou can configure WireMock using the following ways:\n\n- Passing the CLI arguments\n- Passing Environment variables\n- Passing configuration files via volumes\n- Building a custom image using `wiremock/wiremock` as a base image\n\n### Passing the CLI arguments\n\nTo start with these WireMock arguments,\nyou can add them to the end of the command line.\nFor example, to enable HTTPs: `--https-port 8443 --verbose`\n\n```sh\ndocker run -it --rm -p 8443.12443 wiremock/wiremock --https-port 8443 --verbose\n```\n\n### Using environment variables\n\nThe following environment variables are supported by the image:\n\n- `uid` : the container executor uid, useful to avoid file creation owned by root\n- `JAVA_OPTS` : for passing any custom options to Java e.g. `-Xmx128m`\n- `WIREMOCK_OPTIONS`: CLI options to be passed to WireMock (starting from `3.2.0-2`).\n\nExample for passing the CLI options:\n\n```sh\ndocker run -it --rm \\\n  -e WIREMOCK_OPTIONS='--https-port 8443 --verbose' \\\n  -p 8443.12443 \\\n  --name wiremock \\\n  wiremock/wiremock:latest\n```\n\n### Passing configuration files as volumes\n\nInside the container, the WireMock uses `/home/wiremock` as the root from which it reads the `mappings` and `__files` directories.\nThis means you can mount a directory containing these from your host machine into Docker and WireMock will load the stub mappings.\n\nTo mount the current directory use `-v $PWD:/home/wiremock` e.g.:\n\n```sh\ndocker run -it --rm \\\n  -p 8080:8080 \\\n  --name wiremock \\\n  -v $PWD:/home/wiremock \\\n  wiremock/wiremock:{{ site.wiremock_version }}\n```\n\n## Building your own image\n\nInside the container, the WireMock uses `/home/wiremock` as the root from which it reads the `mappings` and `__files` directories.\nThis means you can copy your configuration from your host machine into Docker and WireMock will load the stub mappings.\n\nWireMock utilizes a custom entrypoint script that passes all provided arguments as WireMock startup parameters. To modify the WireMock launch parameters it is recommended to override the entrypoint in your custom Docker image. \n\n```Dockerfile\n# Sample Dockerfile\nFROM wiremock/wiremock:latest\nCOPY wiremock /home/wiremock\nENTRYPOINT [\"/docker-entrypoint.sh\", \"--global-response-templating\", \"--disable-gzip\", \"--verbose\"]\n```\n\n## Using WireMock extensions\n\nYou can use any [WireMock extension](https://wiremock.org/docs/extensions)\nwith the Docker image.\nThey can be added via CLI and volumes,\nbut for most of the use-cases it is recommended to build a custom image by extending the\nofficial one.\n\n### Using extensions in CLI\n\nFor old style extensions (that don't have Java service loader metadata) you need to add the extension JAR file into the extensions directory and\nspecify the name of the extension's main class via the `--extensions` parameter:\n\n```sh\n# prepare extension folder\nmkdir wiremock-docker/samples/random/extensions\n# download extension\nwget https://repo1.maven.org/maven2/com/opentable/wiremock-body-transformer/1.1.3/wiremock-body-transformer-1.1.3.jar \\\n  -O wiremock-docker/samples/random/extensions/wiremock-body-transformer-1.1.3.jar\n# run a container using extension \ndocker run -it --rm \\\n  -p 8080:8080 \\\n  -v $PWD/wiremock-docker/samples/random/stubs:/home/wiremock \\\n  -v $PWD/wiremock-docker/samples/random/extensions:/var/wiremock/extensions \\\n  wiremock/wiremock \\\n    --extensions com.opentable.extension.BodyTransformer\n```\n\nFor new style extensions the `--extensions` part should not be included as the extension will be discovered and loaded automatically:\n\n```sh\n# prepare extension folder\nmkdir wiremock-docker/samples/random/extensions\n# download extension\nwget https://repo1.maven.org/maven2/org/wiremock/wiremock-grpc-extension-standalone/0.5.0/wiremock-grpc-extension-standalone-0.5.0.jar \\\n  -O wiremock-docker/samples/random/extensions/wiremock-grpc-extension-standalone-0.5.0.jar\n# run a container using extension \ndocker run -it --rm \\\n  -p 8080:8080 \\\n  -v $PWD/wiremock-docker/samples/random/stubs:/home/wiremock \\\n  -v $PWD/wiremock-docker/samples/random/extensions:/var/wiremock/extensions \\\n  wiremock/wiremock\n```\n\n### Using extensions in the Dockerfile\n\n```sh\ngit clone https://github.com/wiremock/wiremock-docker.git\ndocker build -t wiremock-random wiremock-docker/samples/random\ndocker run -it --rm -p 8080:8080 wiremock-random\n```\n\n\u003e Access [http://localhost:8080/random](http://localhost:8080/random) to show random number\n\n## Advanced use-cases\n\n### Using HTTPs\n\nFor HTTPs, the `8443` port is exposed by default.\nTo run with HTTPs, run the following command:\n\n```sh\ndocker run -it --rm -p 8443.12443 wiremock/wiremock --https-port 8443 --verbose\n```\n\nTo check the HTTPs on the default exposed port,\nuse [https://localhost:8443/__admin](https://localhost:8443/__admin) to check HTTPs working.\n\n### Using the Record Mode\n\nIn Record mode, when binding host folders (e.g. $PWD/test) with the container volume (/home/wiremock), the created files will be owned by root, which is, in most cases, undesired.\nTo avoid this, you can use the `uid` docker environment variable to also bind host uid with the container executor uid.\n\n```sh\ndocker run -d --name wiremock-container \\\n  -p 8080:8080 \\\n  -v $PWD/test:/home/wiremock \\\n  -e uid=$(id -u) \\\n  wiremock/wiremock \\\n    --proxy-all=\"http://registry.hub.docker.com\" \\\n    --record-mappings --verbose\ncurl http://localhost:8080\ndocker rm -f wiremock-container\n```\n\n\u003e Check the created file owner with `ls -alR test`\n\nHowever, the example above is a facility.\nThe good practice is to create yourself the binded folder with correct permissions and to use the *-u* docker argument.\n\n```sh\nmkdir test\ndocker run -d --name wiremock-container \\\n  -p 8080:8080 \\\n  -v $PWD/test:/home/wiremock \\\n  -u $(id -u):$(id -g) \\\n  wiremock/wiremock \\\n    --proxy-all=\"http://registry.hub.docker.com\" \\\n    --record-mappings --verbose\ncurl http://localhost:8080\ndocker rm -f wiremock-container\n```\n\n\u003e Check the created file owner with `ls -alR test`\n\n### Docker Compose\n\nConfiguration in compose file is similar to Dockerfile definition\n\n```yaml\n# Sample compose file\nversion: \"3\"\nservices:\n  wiremock:\n    image: \"wiremock/wiremock:latest\"\n    container_name: my_wiremock\n    entrypoint: [\"/docker-entrypoint.sh\", \"--global-response-templating\", \"--disable-gzip\", \"--verbose\"]\n```\n\nYou can also mount your local `__files` and `mappings` files into the container e.g:\n\n```yaml\n# Sample compose file\nversion: \"3\"\nservices:\n  wiremock:\n    image: \"wiremock/wiremock:latest\"\n    container_name: my_wiremock\n    volumes:\n      - ./__files:/home/wiremock/__files\n      - ./mappings:/home/wiremock/mappings\n    entrypoint: [\"/docker-entrypoint.sh\", \"--global-response-templating\", \"--disable-gzip\", \"--verbose\"]\n```\n\n## References\n\n- [WireMock modules for Testcontainers](https://wiremock.org/docs/solutions/testcontainers/), based on this official image\n- [Helm Chart for WireMock](https://wiremock.org/docs/solutions/kubernetes/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiremock%2Fwiremock-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwiremock%2Fwiremock-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwiremock%2Fwiremock-docker/lists"}