Setup DuckRails via Docker

Lazarus Lazaridis edited this page Nov 18, 2017 · 2 revisions

A docker image is available at docker hub under iridakos/duckrails.

Getting the image

This image is being produce automatically each time something is pushed in the master branch of the repository or when a new release of DuckRails takes place.

To obtain the image with the latest master branch code, use this command from your terminal:

docker pull iridakos/duckrails

This command will automatically fetch the :latest tag of the image.

To obtain a release image, use the following command from your terminal:

docker pull iridakos/duckrails:release-<version>

Replace <version> with the version of DuckRails that you want to use. You can view all available docker image tags for DuckRails here.

Example command for version 2.1.0:

docker pull iridakos/duckrails:release-v2.1.0

Starting the application

To start the application and bind it to a port (ex. 4000) use:

docker run -p <your_port>:80 -v <volume_name>:/opt/duckrails/db iridakos/duckrails:<tag>
  • Replace <port> with the port in which you want to access the application.
  • Replace <tag> with the tag of the images that you have downloaded.
  • Replace <volume_name> with the desired volume name. This will allow you to keep the mocks saved in the database after stopping the docker container. Use the same volume the next time you start DuckRails and your mocks will be there.

For example, if you downloaded version 2.1.0 and you want to access the application on port 8080, the command becomes:

docker run -p 8080:80 -v duckrails:/opt/duckrails/db iridakos/duckrails:release-v2.1.0

You should see something like this: docker command output in terminal

Navigate to http://localhost:8080 and you should be seeing the application's home page. duckrails home page

Well, hAPI mocking!

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.