简体   繁体   中英

Logs of nginx(non-root) container logs

What additional permissions do I need in dockerfile in order to see the logs of the container, I can see the openshift pod is accessible but logs are not rolling Logs:

output of oc logs -f podname is as below

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf differs from the packaged version /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Configuration complete; ready for start up

I am using nginx debian image

Permissions in dockerfile to the new user: /var/cache/nginx,/var/log/nginx,/etc/nginx,/etc/nginx/conf.d,/etc/nginx/nginx.conf,/var/log/nginx,/var/www/html,/var/run/nginx.pid

Just use

docker logs <container-name>

to look at the logs

Your logs need to be on STDOUT and STDERR for you to see the logs. Here is an answer that will help you do that with NGINX. You will have to create a custom image by adding one RUN command. But I think this should get you what you need:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM