Linked Questions

Popular Questions

I'm trying to run a javascript app on localhost:8000 using docker. Part of what I would like to do is swap out some config files based on the docker run command, I'd like to pass an environment variable into the container so that the bash script can use that as a parameter.

What my dockerfile is looking like is this:

FROM nginx
COPY . /usr/share/nginx/html
CMD ["bash","/usr/share/nginx/html/"]

And the bash script looks like this:

if [ "$SECURITY_VERSION" = "OPENAM" ]; then
    sed -i -e 's/localhost/openam/g' authConfig.js

docker run -p 8000:80 missioncontrol:latest -e SECURITY_VERSION="TEST"

Docker gives me an exception saying -e exec command not found.

However if I change the dockerfile to use ENTRYPOINT instead of CMD, the -e flag works but the webserver does not start up.

Is there something I'm missing here? Is the ENTRYPOINT being overriden or something?


So I've updated my dockerfile to use ENTRYPOINT ["bash","/usr/share/nginx/html/", ";", " nginx -g daemon off;"]

But the docker container still shuts down. Is there something I'm missing?

Related Questions