I have a simple Dockerfile that doesnt seem to be executing the CMD command.
FROM nginx
#Expose port 80
EXPOSE 80
#Start nginx server
#RUN service nginx start
COPY startup_nginx.sh /startup_nginx.sh
RUN chmod +x /startup_nginx.sh
#CMD ["/usr/bin/wc","--help"]
CMD ['/startup_nginx.sh']
What could be the problem?
It turns out that I need double quotes instead of single like this.
CMD ["/startup_nginx.sh"]
Note This is not explicit in the docs and seems like something basic that should be spelled somewhere as there are no error messages. It fails silently which makes it extremely hard to debug as the startup script is what is needed to create a running process so the container doesnt exit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With