Skip to content
This repository has been archived by the owner on Mar 6, 2019. It is now read-only.

env var DATA_DIR not set #8

Closed
qlex opened this issue Jul 17, 2017 · 4 comments · Fixed by #53
Closed

env var DATA_DIR not set #8

qlex opened this issue Jul 17, 2017 · 4 comments · Fixed by #53

Comments

@qlex
Copy link

qlex commented Jul 17, 2017

Maybe a dumb question, but eventough i created /tmp/data folder, upon ./build.sh I'm getting:
env var DATA_DIR not set error.

@dianashk
Copy link
Contributor

Hi @qlex! Excellent question. There are many ways to set that DATA_DIR environment variable. If you're running the build.sh script it needs to be explicitly exported or specified along with the execution.

export DATA_DIR=/tmp/data 
./build.sh

Or

DATA_DIR=/tmp/data ./build.sh

@kannes
Copy link

kannes commented Oct 13, 2017

https://github.com/pelias/dockerfiles#prerequisites says to

A directory for storing downloaded datasets. Set DATA_DIR to the folder's path in .env file.

which did nothing for me. Maybe qlex was misled by that just like I was.

@orangejulius
Copy link
Contributor

orangejulius commented Oct 16, 2017

Hey @qlex and @kannes,

Thanks for pointing this out. It looks like the code is a bit torn between two approaches: using a shell environment variable, as @dianashk suggested above, and using the .env file which is used only by docker-compose.

One option we could take to fix this would be to remove the line that checks for that environment variable in build.sh. However, then it would be required that we build checking for that environment variable into each of our Docker images (I think), which would be rather repetitive.

The other option is to use only shell environment variables, and drop usage of the .env file completely. Then all our scripts can directly enforce needed variables. The downside here is docker-compose up by itself would probably not work.

@orangejulius
Copy link
Contributor

Hi all. We've discovered in #48 that we can make our shell scripts and docker-compose use the .env file fairly easily. So now there's no need to run export DATA_DIR=... any more, and only one place to keep up to date!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants