How to run docker for newman with environment and global json

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 “” --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 “” --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:

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.