From 1c546ac62476d981a819f0e398eeaf54210956a0 Mon Sep 17 00:00:00 2001 From: rodolpheche Date: Fri, 27 Nov 2015 00:54:49 +0100 Subject: [PATCH] Initial commit --- .gitignore | 3 +++ Dockerfile | 15 +++++++++++++++ readme.md | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 readme.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5c8d305 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.project +.settings +.idea \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4053dd3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM java:8-jdk + +ENV WIREMOCK_VERSION 2.0.6-beta + +RUN wget -q https://repo1.maven.org/maven2/com/github/tomakehurst/wiremock-standalone/${WIREMOCK_VERSION}/wiremock-standalone-$WIREMOCK_VERSION.jar + +RUN useradd wiremock -m +USER wiremock +WORKDIR /home/wiremock + + +VOLUME /home/wiremock +EXPOSE 8080 443 + +CMD java -jar /wiremock-standalone-$WIREMOCK_VERSION.jar $WIREMOCK_ARGS diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..f8bb929 --- /dev/null +++ b/readme.md @@ -0,0 +1,37 @@ +# Wiremock Docker + +> [Wiremock](http://wiremock.org) standalone HTTP server Docker image + +## Supported tags and respective Dockerfile links : + +- `2.0.6-beta`, `latest` [(2.0/Dockerfile)](https://github.com/rodolpheche/wiremock-docker/blob/2.0.6-beta/Dockerfile) + +## How to use this image + +The image include + +- `EXPOSE 8080 443` : the wiremock http/https server port. + +- `VOLUME /home/wiremock` : the wiremock data storage. + +Launch a Wiremock container + +```sh +$ docker run -d -v $PWD/stub:/home/wiremock -p 8080:8080 rodolpheche/wiremock +``` + +> Simply access [http://localhost:8080/__admin](http://localhost:8080/__admin) to check your mappings + +Launch a Wiremock container with Wiremock arguments + +```sh +$ docker run -d -v $PWD:/home/wiremock -p 8080:8080 -e WIREMOCK_ARGS="--verbose" rodolpheche/wiremock +``` + +> `mappings` and `files__` folders created if not exist + +Stop the container with Wiremock HTTP API + +```sh +$ curl -XPOST http://localhost:8080/__admin/shutdown +```