Dockerfile Overriding ENV variable

What you have described should work just fine. Given:

$ cat Dockerfile
FROM socialengine/nginx-spa
ENV API_URL localhost:6007
$ docker build -t ui .
[...]

Consider this:

$ docker run -it --rm ui env | grep API_URL
API_URL=localhost:6007

Compared to:

$ docker run -it --rm -e API_URL='production:6007' ui env | grep API_URL
API_URL=production:6007

Passing a -e VARNAME=varvalue on the docker run command line will override a default set in your Dockerfile.

If you are seeing different behavior, please update your question to show exactly the command you are running and the associated output.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)