Is it possible to define environment variable using existing one during to container start using docker run
or docker-compose up
?
For example, Dockerfile
contains
ENV JAVA_OPTS="-server"
I want to define new JAVA_OPTS
variable during to container start that uses existing, somehow like
docker run -e JAVA_OPTS="${JAVA_OPTS} -DmyNewParam=1" my_image
and as a result the environment variable inside running container should be -server -DmyNewParam=1