How to run docker for newman with environment and global json

Archived topic — this may be out of date.
Newman has been replaced by the Postman CLI, Postman’s official, signed command-line tool. It runs collections as Newman did, and also lints API specs, runs mocks and monitors, and syncs local files with Postman from your terminal, CI/CD pipeline or coding agent.
Working with an AI coding agent? The Postman plugin lets agents in Claude Code, Cursor, Codex and others design, mock, test and ship APIs with Postman.
For current help, see the Postman docs, try the free Postman tools (no account needed), or join us on Discord.

Tried adding docker for newman with below commands:

1.Pulling the image:docker pull postman/newman_ubuntu1404
2.docker run --name=“newman” -v /tests/apitest.json:/tmp/newman -t postman/newman_ubuntu1404 run “https://www.getpostman.com/collections/collectionId” --environment=~/envt/staging.json --globals=~/data/globals.json and it throws below error even tough the given path is right:

unable to read data from file “~/environments/staging.json”
ENOENT: no such file or directory, open ‘~/environments/staging.json’

So how do I pass the tests, environment and globals JSON in docker.

@saripr This can be streamlined by placing both: the globals as well as environment variable files in the same directory, such as /tests, for example. Then, you can run the Docker container as follows:

docker run --name=“newman” -v /tests:/tmp/newman -t postman/newman_ubuntu1404 run “https://www.getpostman.com/collections/collectionId” --environment=staging.json --globals=globals.json

Here, staging.json and globals.json will have to be present in the /tests directory. More details can be found here: https://github.com/postmanlabs/newman/tree/develop/docker

Is there a way to run this and still keep the same folder structure?

I know that I could place everything within the same directory but that’s not really the structure that I would like to achieve. I would also love to have a reports directory to store HTML test run reports.

Can we supply multiple volumes to allow it to pick up the environment file from a sub directory?

Docker newbie, I can get everything working with it all placed in the same directory but always seem to get the same error ‘environment file not found’ etc when I try a specify more volumes and place my environment file in a sub folder.

*I got what i wanted working but I still need to tweak it a bit - I’ll share my solution soon.

can you share your solution

I am having problem with this errorerror: ENOENT: no such file or directory, open ‘/~test/Environment/postman_dev.json’

I create this repo around that time and this seemed to work for me but it was a very basic requirement, I was just learning how to use Newman and Docker.

Maybe something in there can help you out?

thank you for sharing.