Docker Community Forums

Share and learn in the Docker community.

Build environment variables

automatedbuilds

(David Bainbridge) #1

I have setting values for my automated builds under BUILD ENVIRONMENT VARIABLES and I reference them in the Dockerfile using

ARG REPOSITORY=
FROM ${REPOSITORY}name:latest

The problem is that the values set under BUILD ENVIRONMENT VARIABLES don’t seem to be passed to the docker build command as a build arg as I expected.

Is there a way to set build args? what is the purpose of BUILD ENVIRONMENT VARIABLES if not for build args?

avèk respè,
/david


(David Bainbridge) #2

Figured out that you have to manage build args via overriding the hooks/build script. Would be better if the args would be automatically set via the UI/API, but at least there is a way.

I have a hooks/build script that works for me, but wondering if the default build script is available someplace, so in stead of attempting to guess what is correct, I could actually just augment the actual script with what I need.