Docker

Docker

What is Docker?

Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux.

Castle Mock absolutely loves Docker. Docker allows you to simply setup and deploy your own instance of Castle Mock, by just typing one line. Download and install Docker by visiting their web page: http://docker.com

Usage

Use our official Docker image to setup and test Castle Mock:

docker run -d -p 8080:8080 castlemock/castlemock

Castle Mock can be accessed from the following address after the installation is finished

http://{CONTAINER IP}:8080/castlemock

Persistence

The data files created by Castle Mock can be accessed and stored outside the Docker container. In order to achieve this, you need to create a new volume. This is done by using the -v flag. Run the following command to store Castle Mock’s data files in the directory your currenty at.

docker run -d -p 8080:8080 -v $(pwd):/root/.castlemock castlemock/castlemock

Previous versions

Each Castle Mock version since 1.20 is marked with a tag. This means that you can download a particular version by provided a version number. A complete list of tags can be found on the following webpage: https://hub.docker.com/r/castlemock/castlemock/tags/

Run the following command to download a particular version of Castle Mock:

docker run -d -p 8080:8080 castlemock/castlemock:1.28