Docker Community Forums

Share and learn in the Docker community.

Docker images open badly

(Pulli23) #1

In the process of am making a docker, I have to change its command from /bin/sh to nginx -g "daemon off;" (exactly that).

I wrote:

docker commit --change="EXPOSE 80" --change='CMD ["nginx", "-g", "\"daemon off;\""]' ${arr[0]} mine/nginx_final

Where ${arr[0]} expands to the correct docker container.

However when I try to run this docker it fails with the error:

nginx: [emerg] unexpected end of parameter, expecting ";" in command line

Docker inspect also doesn’t show anything bad:

        "Cmd": [
            "\"daemon off;\""

expected, and i expect the "\"daemon off;\"" to expand to “daemon off;”

Yet I’m pretty sure there is a ; sign after deamon off. Where did this sign go? And how can I debug this? (And fix it)

(Sam) #2

i think the ‘;’ needs to be after the close quote