Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fly.io ENV available in Dockerfile

Tags:

fly

Im trying to access env variables that are specified in the fly.toml file in the Dockerfile when running flyctrl deploy however they are always showing as empty strings. Am i doing something wrong here?

[env]
  API = "ABC"
ARG API
ENV API $API
RUN echo $API // prints Run echo
like image 331
Peter I Avatar asked Oct 22 '25 07:10

Peter I


1 Answers

Turns out this can be done with '[build.args]'

[build.args]
  API = "ABCD"
like image 186
Peter I Avatar answered Oct 24 '25 01:10

Peter I



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!