Setting Environment Variables

Is it possible to set environment variables at build as opposed to setting them via the Balena Dashboard UI.

I have tried using the following in my Dockerfile.template and the variables are not being shown in the cloud UI.

ENV server_ip="12.34.56.789"
ENV server_port=4321
ENV heartbeat_endpoint="heartbeat"
ENV geoposition_endpoint="geoposition"

Hey @Tissy if you specify variables in this way they will work and be present for the build and the resultant image, but they’re isolated from the cloud backend, and so won’t propagate back ‘upwards’ and display in the cloud UI.

So to answer your question, you can specify them at build (and it will work), but this method is not integrated with the cloud UI.

Hope this helps!