Answer the question
In order to leave comments, you need to log in
How to pass config files with variables if not via ConfigMap which is read-only?
I catch an error starting nginx in k8s:
1) on the side of the image with the transfer of the nginx configuration to the image via the Dockerfile (as is: COPY *.conf /etc/nginx/conf.d/)
nginx -T
envsubst: error while reading "standard input": Is a directory
nginx: [emerg] unknown "branch_name" variable
nginx: configuration file /etc/nginx/nginx.conf test failed
can't create /etc/nginx/conf.d/default.conf: Read-only file system
Answer the question
In order to leave comments, you need to log in
In the official nginx images, it is enough to create them in /etc/nginx/templates/
with the suffix .template
.
The file with replacement variables is mounted as a /etc/nginx/templates/config.conf.template
Shell script, pulled by the entrypoint, copied with substitution and it turns out/etc/nginx/conf.d/config.conf
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question