Hi, It took me awhile to figure out that `env_vars...
# prefect-server
r
Hi, It took me awhile to figure out that
env_vars
in the Docker Storage, are variables that are added to the end of my Dockerfile. this should probably be mentioned in the documentation. Since the ENV command is added to the end of the file, you cannot actually pass any variables that are used in the build process itself.
j
Hi @Roey Brecher - Thanks for the feedback. Do you think you could share a link to the part of docs page you think that update should go to? Or would you even be up for adding that update to the docs?
j
hey @Roey Brecher this is interesting to me, and I'm surprised to hear it! It might just be an oversight, and I think if you proposed a PR that changed this behavior it would probably be accepted (I'm not a prefect maintainer, just a random person in the community here). Docker storage templates a Dockerfile right here: https://github.com/PrefectHQ/prefect/blob/master/src/prefect/environments/storage/docker.py#L536-L555
upvote 1
r
@Jenny it is here https://docs.prefect.io/api/latest/environments/storage.html#docker (env_vars) unfortunately the bureaucracy of a pull request is too much of a hassle for such a small change šŸ˜‚
@james.lamb Iā€™m not sure if this is the intended behaviour or not, perhaps a maintainer could answer that. if anyone else encounters this issue, I solved it using a
.env
file and this Docker command:
Copy code
RUN export $(cat ./.env | grep -v '#' | awk '/=/ {print $1}')
You then need to make sure you have a
.env
file being copied to the container during build.
j
Thanks for sharing that - I'm actually going to check with the team on this one about whether we should update the docs or whether we should update the behavior. Any ideas on how we reduce that bureaucracy to encourage small changes are also very welcome šŸ˜
@Roey Brecher - I've added an issue requesting that we update the behavior: https://github.com/PrefectHQ/prefect/issues/3640. Please add any more information you have there.