My OS is Win10, with HyperV disabled. Both Vagrant & Virtual Box are the 
latest version. Trying to run a Github project. Ran into problems of 
setting up the environment variables.

In my Vagrantfile on the host OS, to run the docker-compose.yml, I have 
these statements:

  config.vm.provision :docker, run: "always"
  config.vm.provision :docker_compose, 
  yml: "/vagrant/docker-compose.yml", 
  rebuild: true, 
  run: "always"

I have the vagrantfile, docker-compose.yml and .env files for this project 
are located in the same folder in my Windows host.
When I ran vagrant up, I got warnings (they were more than warnings, 
actually all the containers started and stopped almost instantaneously 
after I ran vagrant up. When I restarted the containers inside the guest 
OS, these containers stopped within a few seconds.)

The warnings are something like:

WARNING: The POSTGRES_VERSION variable is not set. Defaulting to a blank 
string.
…

Note: The problems that I am experiencing is almost identical to this old 
posting by someone else:
https://sourceforge.net/p/sf-compose/tickets/6581/

I believe failing to set the environment variables is the main reason why 
the containers fail to run.

I vagrant ssh into the directory inside the virtual OS (Ubuntu) for this 
project. I can see the vagrantfile, docker-compose.yml, .env are all in the 
same directory in the guest OS. I nano the contents of these files, they 
are identical to the same files in my host folder.

I googled, the general conclusion is: 
For this to happen (aka unable to set the environment variables), the .env 
and docker-compose.yml files are not in the same directory where the yml is 
being run. But in my case, they are.

Can someone please advise me what I should do to set/register the 
environment variables in the containers?

Thanks in advance.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/hashicorp/vagrant/issues
Discuss: https://discuss.hashicorp.com/c/vagrant/24
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vagrant-up+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/233696d4-76d0-4708-86ce-4df79e2dc7a3n%40googlegroups.com.

Reply via email to