Set multiple Environment Variables

I am writing a docker file in which at one specific step I am generating dynamic secret file which contains a lit of approx 20 env. variables, in below stand format:

export ABC=‘XXXXXXX’
export DEF=‘XXXXXXX’
export GHI=‘XXXXXXX’
export JKL=‘XXXXXXX’

I want to set all this variables values in env. variables.
I ran below command but unable to set this values in ENV

RUN . ./secrets/env

The current option I am using now is as below:
ENV ABC ${xxxx}

Is there option available to set all secret file values as Env. values.

To set environment variables in a Docker container, you can use the -e flag when running the docker run command. For example:
$ docker run -e VAR_NAME1=value1 -e VAR_NAME2=value2 image_name

This will set the environment variables VAR_NAME1 and VAR_NAME2 to the values value1 and value2 , respectively, in the container.

Since every run instruction is a new container during docker build, you can’t set a variable like that and use it in an ENV instruction. You could only use that in the same instruction (same container and shell).

You could easily pass the variable as build arguments, but if those are actual secrets, like passwords, I wouldn’t store them in the image at all.