Many of you had questions regarding how to get Newman running within a Docker container. Following that, we decided to release the official Docker image of Newman. Head over to the Docker hub and pull your copy.
The following bits are straight from the README of newman-docker Github repository…
To begin, ensure that you have Docker installed and running in your system. Docker has extensive installation guideline for popular operating systems. Choose your operating system and follow the instructions. A quick test to see if Docker is installed correctly is to execute the command
docker run hello-world and it should run without errors.
Step 1 – Pull the newman Docker image
docker pull postman/newman_ubuntu1404
Step 2 – Run newman commands on the image
docker run -t postman/newman_ubuntu1404 --url="https://www.getpostman.com/collections/8a0c9bc08f062d12dcda"
At this stage, you should see Newman running the collection and the output being visible on the terminal. The
entrypoint to the Docker image is
newman and as such, all command line parameters of newman can be used here. You can also run locally stored collection files. The README of the image outlines the procedure of mounting shared data volumes to achieve this.
Too many new terminologies?
Newman is a command-line collection runner for Postman. It allows you to effortlessly run and test your API endpoints, within Postman Collections, directly from the command-line. It is built with extensibility in mind so that you can easily integrate it with your continuous integration servers and build systems.
On the other hand, Docker allows you to package an application with all of its dependencies into a standardized unit for software development. Visit https://www.docker.com/why-docker to read more about how Docker can drastically simplify development and deployment.
Together, you can now run Newman command-line tool in a way it has been packaged by us without being bothered about operating system dependencies, environment setup, etc.