Docker Community Forums

Share and learn in the Docker community.

Can not use build environment variables configured on docker hub builds

Hey guy’s

I’m trying to automate my build with the builds function on docker hub but now I’ve got a problem with the build env variables. I can’t access or use them in my Dockerfile.

I have configured several variables in the build section of my repository and would like to use them in my Dockerfile during the build.

Is this even possible?

Example:

I have configured a variable called “APP_VERSION” and a value (like 1.0 or something).

For debug purposes I’m exposing the variable by using echo like those example:

// not working
echo $APP_VERSION

// not working
echo ${APP_VERSION}

// not working
ENV APP_VERSION = ${APP_VERSION}
echo APP_VERSION

Unfortunately every echo is empty.

What am I doing wrong?