Docker Build Args

We have a few Docker builds that require passing build arguments to configure the container environment. Normally passed to the build command like so:

docker build --build-arg VAR=foo

Is there any way to configure an application to use build args? Can an environment variable be passed as the value?

If that isn’t an option - is there a way to configure an application to use a pre-built container image from an ECR repo (or other container repo) ?

2 Likes

Hi @worthc21 :wave: , I reply inline,

Qovery automatically injects all your environment variables and secrets as build args (and run args). So it will work. Did you try?

From the documentation: Qovery makes Environment Variables available to your services at runtime, as well as during builds and deploys.

It is planned to support container deployment for Q2 2022. I put in cc our product managers - cc @Alessandro_Carrano @a_carrano @Florian_Lepont

Hi Romaric,

I thought I had tested using a configured environment variable during the build - let me try that again. Its possible my ARG value didn’t match the environment variable name configured.

If you show me your Dockerfile, I can also take a look if it’s correctly set up :slight_smile:

It worked! It was an issue with my ARG names not aligning with the alias I had created.

One small UX improvement - would be nice to indicate which application created / exported the environment variable in the list of environment variables. For example, with multiple services, this type of value is repeated:

QOVERY_APPLICATION_Z832AFE71_HOST_EXTERNAL

It’s hard to match up which of the applications in the environment it refers to without viewing the value, then comparing it to the URL of the service by clicking “Open” from the application summary page.

1 Like

There is a small trick, if you put your mouse over the icon, you’ll get the name of the app. (I know it’s not obvious, and thanks for suggesting a better UX).

BTW we’re working on Qovery v3 which is 100% open-source

Ah! Did not notice that - but that’s just what I needed.

1 Like