# Docker Deployment - Errno 2

**URL:** <https://forum.ansible.com/t/docker-deployment-errno-2/33896>\
**Category:** Ansible Project\
**Created:** [September 25, 2020, 1:05pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896 "2020-09-25T13:05:04Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dave\_Gilmore](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Dave\_Gilmore](https://forum.ansible.com/u/Dave_Gilmore)\
**Post date:** [September 25, 2020, 1:05pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896/1 "2020-09-25T13:05:04Z")

</div>

Hi Folks,

I am having some issues deploying containers to a remote host, specifically reading in a env\_file.

The error message I get is:

[Errno 2] No such file or directory: "[‘/usr/local/hg/defaults.env’, ‘/var/lib/data/hg/config.env’]

But I can see the files _are_ deployed to the remote host via Ansible template, i’ve even opened up all the permissions in frustration!

/usr/local/hg/

-rwxrwxrwx 1 root root 29 Sep 25 12:38 **defaults.env**

/var/lib/data/hg/

-rwxrwxrwx 1 root root 273 Sep 25 12:38 **config.env**

These files DO NOT exist on the control node, but I don’t think they need to as Docs state that it’s a file on target - [https://docs.ansible.com/ansible/latest/collections/community/general/docker\_container\_module.html#parameter-env\_file](https://docs.ansible.com/ansible/latest/collections/community/general/docker_container_module.html#parameter-env_file)

This is driving me round the bend a little now, and it’s the last thing i need to finish to meet a deliverable, so close tho the finish line!

I’ve asked on #ansible but nothing fruitful so far.

I am using the docker-py pip module.

Dave.

---

<div class="post-metadata">

**Author:** ![Idan\_Melamed](https://avatars.discourse-cdn.com/v4/letter/i/22d042/32.png) [@Idan\_Melamed](https://forum.ansible.com/u/Idan_Melamed)\
**Post date:** [September 25, 2020, 1:16pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896/2 "2020-09-25T13:16:07Z")

</div>

That error looks to me like it is looking for a file named “[‘/usr/local/hg/defaults.env’, ‘/var/lib/data/hg/config.env’]”.  
Maybe you can only use one env file?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [September 25, 2020, 1:33pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896/3 "2020-09-25T13:33:54Z")

</div>

Hi,

> That error looks to me like it is looking for a file named  
> "['/usr/local/hg/defaults.env', '/var/lib/data/hg/config.env']".  
> Maybe you can only use one env file?

that's correct. The documentation states that the option accepts a  
path, and not a list of paths. (If you pass a list, that list is  
converted to a string.)

Cheers,  
Felix

---

<div class="post-metadata">

**Author:** ![Dave\_Gilmore](https://avatars.discourse-cdn.com/v4/letter/d/b77776/32.png) [@Dave\_Gilmore](https://forum.ansible.com/u/Dave_Gilmore)\
**Post date:** [September 25, 2020, 1:40pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896/4 "2020-09-25T13:40:40Z")

</div>

This is EXACTLY the issue!

Thank you!

I have some shared ENV variables between the 2 containers, but not all ENVs are applicable to the 2nd container, so that’s why I tried to use 2 files.

Was trying to keep my env files DRY.

Think it’s worth a PR ?

Just updating my code…

---

<div class="post-metadata">

**Author:** ![Idan\_Melamed](https://avatars.discourse-cdn.com/v4/letter/i/22d042/32.png) [@Idan\_Melamed](https://forum.ansible.com/u/Idan_Melamed)\
**Post date:** [September 25, 2020, 5:55pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896/5 "2020-09-25T17:55:37Z")

</div>

Hi Dave,  
Maybe you can combine the two files and then pass the new combined file to env\_file?

---

<div class="post-metadata">

**Author:** ![felixfontein](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/felixfontein/32/7530_2.png) [@felixfontein](https://forum.ansible.com/u/felixfontein)\
**Post date:** [September 25, 2020, 6:46pm UTC](https://forum.ansible.com/t/docker-deployment-errno-2/33896/6 "2020-09-25T18:46:38Z")

</div>

Hi,

> Think it's worth a PR ?

if you think this is needed, feel free to create one.

Cheers,  
Felix
