Skip to main content

Install and run

Choose your favorite way to install Mockaco locally or in your server.

.NET CLI

Install and run as a dotnet tool:

$ dotnet tool install -g mockaco
$ mockaco --urls "http://localhost:5000"

A random local port is chosen if --urls parameter is not provided.

Docker

You can run Mockaco from the official Docker image (replace /your/folder with an existing directory of your preference):

$ docker run --pull always -it --rm -p 5000:5000 -v /your/folder:/app/Mocks natenho/mockaco

Docker command breakdown

FlagDescriptionPurpose
docker runThe foundational commandCreates and starts a new Docker container.
--pull alwaysAlways pull imageEnsures you're running the latest version from the registry.
-itInteractive TTYAttaches your terminal to the container to see logs and use Ctrl+C.
--rmRemove on exitAutomatically cleans up and deletes the container when it stops.
-p 5000:5000Publish portMaps localhost:5000 on your machine to port 5000 in the container. The port exposed by the container is 5000 (HTTP) by default.
-v /your/folder:/app/MocksMount volumeLinks your local folder to the container so mockaco can read your mock files.
natenho/mockacoThe Docker imageThe actual application being run—the mock server itself.

From sources

Or your can run it directly from sources:

$ git clone https://github.com/natenho/Mockaco.git
$ cd Mockaco\src\Mockaco
$ dotnet run

A random local port is chosen if --urls parameter is not provided.