I have the following lines in a Dockerfile where I want to set a value in a config file to a default value before the application starts up at the end and provide optionally setting it using the `-e` option when starting the container. 

I am trying to do this using Docker's `ENV` commando

```
 ENV CONFIG_VALUE default_value
 RUN sed -i 's/CONFIG_VALUE/'"$CONFIG_VALUE"'/g' CONFIG_FILE
 CMD command_to_start_app

```

I have the string CONFIG\_VALUE explicitly in the file CONFIG\_FILE and the default value from the Dockerfile gets correctly substituted. However, when I run the container with the added `-e CONFIG_VALUE=100` the substitution is not carried out, the default value set in the Dockerfile is kept. 

When I do

```
docker exec -i -t container_name bash

```

and `echo $CONFIG_VALUE` inside the container the environment variable does contain the desired value 100.