Docker Cloud - Automated build environment variables not being set

When using Docker Cloud Building tools, if you set environment variables, they are not being set when building the image.

I have tried so many different variations of docker files.For example.

ARG MY_ARG=DefaultValue
ENV MY_ENV=$MY_ARG

Program will echo DefaultValue if i have a key in Docker Cloud called MY_ARG with value test

ENV MY_ENV=DefaultValue

Program will echo DefaultValue if i have a key in Docker Cloud called MY_ENV with value test

I have tried all the variations here. Seems it just doesn’t work at all.
Would be really nice if someone from Docker would answer if this is an actual bug…

For reference purposes, this seems related to: Docker Cloud build environment variables not being passed to the auto-build

I have been assuming that the values set in the BUILD ENVIRONMENT VARIABLES section of the auto build would be passed to the docker build command as build args. This does not seem to be the case. What is the purpose or what are the values in BUILD ENVIRONMENT VARIABLES meant to do or be used for?

If you want to use the environment variables as a build arg, you need to add a custom build hook script, as described here:
Advanced options for Autobuild and Autotest | Docker Documentation