simple use-case to deploy the nginx image using kubernetes
Dockerfile used to create the image. The "./build/" in the dockerfile COPY statement, is the output directory (npm run build) of reactjs code.Just static files in it.
FROM nginx
COPY ./build/ /usr/share/nginx/html/
RUN rm -f /etc/nginx/conf.d/default.conf
COPY ./default.conf /etc/nginx/conf.d/
CMD ["nginx"]
EXPOSE 80
Why is this error in nginx deployment? error is "Back-off restarting failed container". manually ran the container, but nginx is not running. I could start the nginx manually. Am I missing any configuration in the Dockerfile or in /etc/nginx/conf.d/default.conf file? files are copied and available in github path for reference.
root@desktop:~/github/nginx-app# docker run -it private.registry.corp/company-dev-poc/nginx-cms:001 bash
root@fc7ebd431ae2:/# service nginx status
[FAIL] nginx is not running ... failed!
docker run ... bash
, it means you created a container from an image and had run a singlebash
process in it. What you probably need instead is to run without a command name – zerkmsCMD
has quit. – zerkms