[ad_1]
My directory structure looks like this.
|
|
— Dockerfile
| — .env
Content of .env
file looks like this.
VERSION=1.2.0
DATE=2022-05-10
I want to access VERSION
and DATE
as environment variable both during build time and run time. So ENV
is the one I should use. I know that.
How exactly can I do that ?
I tried using RUN
command in Dockerfile
like
RUN export $(cat .env)
But, it can only be accessed during runtime and not build time.
So, how can this be achieved with ENV
?
P.S. I cannot use docker-compose
because the image is going to be used by kubernetes pods, so.
[ad_2]