How to add environment variables accessible from a...
# 🌱|help-and-getting-started
p
With this garden.yml :
Copy code
kind: Build
name: app
type: container
variables:
  $merge: ${var.commonConf.app.env}
spec:
  dockerfile: Dockerfile
And in the DockerFile with this command :
RUN printenv
I don't see my variables , why and what can I do ?, thank you in advance
f
Hi @plain-pizza-51556 , in order to pass variables to a docker build so they are available during build it is best to use the
ARG
instruction see https://docs.docker.com/reference/dockerfile/#arg. You can pass these in with garden via
spec.buildArgs
see https://docs.garden.io/reference/action-types/build/container#spec.buildargs Does that help?
p
thank you ! Yes i think i can play with it
2 Views