my app has feature flags that i would like to dynamically set to true for my `npm build`.
essentially i'd like to do something like 
`COMPILE_ASSETS=true npm build` or `NEW_EMAILS=true npm build`, only dynamically from CI. 

i have a CI pipeline that will grab the flag, but am having trouble setting it to the true and running npm in the Dockerfile.

my Dockerfile - 

```
FROM ubuntu:bionic
ARG FEATURE_FLAG
RUN if [ "x$FEATURE_FLAG" = "x" ] ; \
    then npm run build ; \
    else $FEATURE_FLAG=true npm run build; \
    fi

```

this gets run with -- 

`docker build --no-cache --rm -t testing --build-arg FEATURE_FLAG=my_feature_flag .` (i would like to keep this the way it is) 

in CI i get 

`/bin/sh: 1: my_feature_flag=true: not found`

i've tried various forms of the else statement --

* `else export $FEATURE_FLAG=true npm run build;` (this actually looks like it works on my mac but fails in CI with `export: : bad variable name`
* `else ${FEATURE_FLAG:+$FEATURE_FLAG=true} npm build;`
* `else eval(`$FEATURE_FLAG=true npm build`);`
* `else env $FEATURE\_FLAG=true bash -c 'npm build';

these all fail :( 

i've tried reworking the Dockerfile completely and setting the flag to true as an ENV -- 

```
ARG FEATURE_FLAG
ENV FF_SET_TRUE=${FEATURE_FLAG:+$FEATURE_FLAG=true}
ENV FF_SET_TRUE=${FF_SET_TRUE:-null}
RUN if [ "$FF_SET_TRUE" = "null" ] ; \
    then npm build; \
    else $FF_SET_TRUE npm build; \
    fi

```

nothing works! is this simply a bash limitation? is expanding a variable before running a command is not possible? 

or is this not possible with Docker?