# Unable to run newman collection on docker

**URL:** <https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519>\
**Category:** Help Hub\
**Tags:** newman-project, docker, image\
**Created:** [October 6, 2020, 2:27pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519 "2020-10-06T14:27:26Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 6, 2020, 2:27pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/1 "2020-10-06T14:27:26Z")

</div>

**Your question may already have an answer on the community forum. Please search for related topics, and then read through the [guidelines](https://community.postman.com/t/about-the-just-getting-started-category/37) before creating a new topic.**

Hi guys, I’m fairly new with docker, however I came across various blogs on how to run local collections on docker, but I still get an error, any help would be appreciate. I have the following that I would like to mount on the newman image

docker run -v /C:/Users/msingathi.majola/collection:/etc/postman -t postman/newman\_ubuntu1404 \run “https:/www.getpostman.com/collections/xxxxx” --environment=“Test.postman\_environment.json” -—ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”

and the error I get is as follows docker: Error response from daemon: invalid mode: /etc/postman.

---

<div class="post-metadata">

**Author:** ![gpub1](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@gpub1](https://community.postman.com/u/gpub1)\
**Post date:** [October 6, 2020, 7:39pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/2 "2020-10-06T19:39:16Z")

</div>

Welcome @mseerah to community

Remove : from the path. try run again. It should work

```auto
/etc/postman

```

---

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 6, 2020, 8:02pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/3 "2020-10-06T20:02:55Z")

</div>

> [@mseerah](#):
>
> docker run -v /C:/Users/msingathi.majola/collection:/etc/postman -t postman/newman\_ubuntu1404 \run “https:/www.getpostman.com/collections/xxxxx” --environment=“Test.postman\_environment.json” ----ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”

@gpub1 thanks for the response, however tried removing from “:/etc/postman” and it still did not work. this is what I posted now  
docker run -v /C:/Users/msingathi.majola/collection /etc/postman -t postman/newman\_ubuntu1404 \run “https:/www.getpostman.com/collections/xxxxx” --environment=“Test.postman\_environment.json” ----ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”

and the error is this  
error: unknown option ‘–environment=Test.postman\_environment.json’

---

<div class="post-metadata">

**Author:** ![gpub1](https://avatars.discourse-cdn.com/v4/letter/g/f6c823/32.png) [@gpub1](https://community.postman.com/u/gpub1)\
**Post date:** [October 6, 2020, 8:25pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/4 "2020-10-06T20:25:59Z")

</div>

Try this there was single space in path you gave

```auto

```

---

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 6, 2020, 8:49pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/5 "2020-10-06T20:49:31Z")

</div>

Unfortunately with this  
docker run -v /C:/Users/msingathi.majola/collection/etc/postman -t postman/newman\_ubuntu1404 \run “https:/www.getpostman.com/collections/xxxxx” --environment=“Test.postman\_environment.json” ----ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”  
error: unknown option ‘–environment=Test.postman\_environment.json’  
it still does not work, even without the “/etc/postman”

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [October 6, 2020, 9:22pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/6 "2020-10-06T21:22:54Z")

</div>

@mseerah,

Hey there,

You need to use `--` to separate flags being sent to the process in the container vs flags being sent to the Docker client. Something like this should work:

```auto
docker run -v /C:/Users/msingathi.majola/collection:/etc/newman -t postman/newman run "https:/www.getpostman.com/collections/xxxxx" -- --environment="Test.postman_environment.json" --ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile="newman-report.xml"

```

Best,

Kevin

---

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 7, 2020, 7:01am UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/7 "2020-10-07T07:01:05Z")

</div>

hi @kevin.swiber this is very helpful, but once again I’m getting an error as follows  
**docker: Error response from daemon: invalid mode: /etc/newman.**  
\*\* See ‘docker run --help’.\*\*  
Not really sure what is the issue with this newman folder on the image, cause when I inspect it, I don’t seem to find any issues on it

---

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 7, 2020, 7:18am UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/8 "2020-10-07T07:18:50Z")

</div>

Also, I just tried to modify my drive according to something I came across from stackoverflow as follows:  
` docker run -v /c/Users/msingathi.majola/collection:/etc/newman -t postman/newman run "https:/www.getpostman.com/collections/xxx" -- --environment="Test.postman_environment.json" --ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile="newman-report.xml"`  
_error: collection could not be loaded_

- unable to read data from file “https:/www.getpostman.com/collections/xxx”\*
- ENOENT: no such file or directory, open ‘https:/www.getpostman.com/collections/xxx’\*

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [October 7, 2020, 5:50pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/9 "2020-10-07T17:50:20Z")

</div>

> [@mseerah](#):
>
> - unable to read data from file “https:/www.getpostman.com/collections/xxx”\*
> - ENOENT: no such file or directory, open ‘https:/www.getpostman.com/collections/xxx’\*

Hey @mseerah,

You’re missing a slash after the URL scheme, so it’s reading it as a file. You need to change `https:/` to `https://`.

Best,

Kevin

---

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 8, 2020, 7:11am UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/10 "2020-10-08T07:11:54Z")

</div>

> [@mseerah](#):
>
> docker run -v /c/Users/msingathi.majola/collection:/etc/newman -t postman/newman run “https:/www.getpostman.com/collections/xxx” – --environment=“Test.postman\_environment.json” --ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”

Thanks @kevin.swiber this is awesome, but just a quick one, have you worked with self assigned certificates, my main problem now is that I can’t execute because of the following error `error: collection could not be loaded unable to fetch data from url "https://www.getpostman.com/collections/xxx" self signed certificate in certificate chain`

---

<div class="post-metadata">

**Author:** ![kevin.swiber](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/kevin.swiber/32/3820_2.png) [@kevin.swiber](https://community.postman.com/u/kevin.swiber)\
**Post date:** [October 8, 2020, 6:17pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/11 "2020-10-08T18:17:06Z")

</div>

Hey @mseerah,

That’s weird. Perhaps it’s a bug in newman. I would brute force the `insecure` flag by altering a variable that will impact Node.js and see if that helps. You’ll need to add `--env NODE_TLS_REJECT_UNAUTHORIZED='0'` to your `docker run` command like so:

```auto
docker run --env NODE_TLS_REJECT_UNAUTHORIZED='0' -v /c/Users/msingathi.majola/collection:/etc/newman -t postman/newman run “https:/www.getpostman.com/collections/xxx” – --environment=“Test.postman_environment.json” --ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”

```

Best,

Kevin

---

<div class="post-metadata">

**Author:** ![mseerah](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/mseerah/32/5836_2.png) [@mseerah](https://community.postman.com/u/mseerah)\
**Post date:** [October 9, 2020, 1:52pm UTC](https://community.postman.com/t/unable-to-run-newman-collection-on-docker/16519/12 "2020-10-09T13:52:54Z")

</div>

> [@kevin.swiber](#):
>
> `docker run --env NODE_TLS_REJECT_UNAUTHORIZED='0' -v /c/Users/msingathi.majola/collection:/etc/newman -t postman/newman run “https:/www.getpostman.com/collections/xxx” – --environment=“Test.postman_environment.json” --ssl-client-cert matthew.cer --ssl-client-key matthew.key --insecure --testReportFile=“newman-report.xml”`

Good news @kevin.swiber it’s working now, I used this command and it now works, with a lil tweak, I just changed my collection to point to my local one which is in a “.json” format instead of that url hyperlink, but thank you so much for your help 🙂
