I have a pod with nginx image, but it also has the command "nginx".
apiVersion: v1
kind: Pod
metadata:
name: nx
spec:
containers:
- name: nginx
image: nginx
command: ["nginx"] #what does this do? it’s not bin/sh -c
args: ["-g", "daemon off;", "-q"] ports:- containerPort: 80
-g daemon off is means ‘nginx runs in quiet mode.
But what is ‘nginx’ cmd actually? Does it mean it says enter the actual web-server nginx?
2
Answers
nginx
: Yes , this command starts nginx server.Nginx command line optionsdaemon off
option fornginx
command runs nginx in foreground instead of running it as a system daemon (background process).difference between daemon off and daemon onIn case you want to run nginx in a docker container, when you set
nginx -g 'daemon off;
you run as a background process as mentioned before, in addition that you can interact with the container terminal.