Docker Community Forums

Share and learn in the Docker community.

Env variables in building aren't set

build

(Andrea Giuliano) #1

When using Docker Cloud Building tools, if you set environment variables, they are not exported when building.
I tried to set an env var and print the var in the building phase, the output is empty.

Is it a bug?


Is it possible to set build time env vars per tag on a repository?
(Anders Bornholm) #2

I’m having the same problem. I’ve tried referencing the variable with and without ARG in the Dockerfile


(Lizter) #3

I am having the same problem. Build time args doesn’t seem to work at all.
I navigate to “Repositories / Details / Builds / Edit” on a repository, and specify Environment variables (shouldn’t they be called “Build-time variables” as per the help text for --build-arg in Docker?). I whitelist the variables I would like to access with ARG in my Dockerfile. This works very well locally when passing the exact same ones with --build-arg, but not at all when trying the same with Docker Cloud.

Major show stopper for me atm, as my builds depend on them.

I also requested build-time variables per tag so I can differentiate between envs on the same repository here: Is it possible to set build time env vars per tag on a repository?
This was before I discovered that they don’t work, though.


(Masterfox) #4

Hello lizter, did you ever find a solution to this problem im currently having the same problem.