非特权NGINX Docker构建文件是指用于构建以非root用户身份在Docker容器中运行NGINX的配置文件,通过预设用户权限、环境变量及安全参数,确保NGINX在低权限模式下仍能正常处理HTTP请求、反向代理及负载均衡等功能,有效降低因容器漏洞引发的权限提升风险,适用于对安全性要求较高的生产环境部署场景。
This repo contains a series of Dockerfiles to create an NGINX Docker image that runs NGINX as a non root, unprivileged user. Notable differences with respect to the official NGINX Docker image include:
- The default NGINX listen port is now
8080instead of80(this is no longer necessary as of Docker20.03but it's still required in other container runtimes). - The default NGINX user directive in
/etc/nginx/nginx.confhas been removed. - The default NGINX PID has been moved from
/var/run/nginx.pidto/tmp/nginx.pid. - Change
*_temp_pathvariables to/tmp/*.
New images are built and pushed to on a weekly basis (every Monday night).
Check out the https://hub.docker.com/_/nginx for the upstream Docker NGINX image for a detailed explanation on how to use this image.
Note: Issues related to security vulnerabilities will be promptly closed unless they are accompanied by a solid reasoning as to why the vulnerability poses a real security threat to this image. Check out the https://github.com/nginxinc/docker-nginx-unprivileged/blob/main/.github/SECURITY.md doc for more details.
Supported Image Registries and Platforms
Image Registries
You can find built images in the following registries:
- GitHub Container Registry - https://github.com/nginxinc/docker-nginx-unprivileged/pkgs/container/nginx-unprivileged
- Docker Hub - https://hub.docker.com/r/nginxinc/nginx-unprivileged
Platforms
Most images are built for the amd64, arm32v5 (for Debian), arm32v6 (for Alpine), arm32v7, arm64v8, i386, mips64le (for Debian), ppc64le and s390x architectures. Alpine slim images are only built for amd64 and arm64v8.
Common Issues
- If you overrive the default
nginx.conffile you may receive the messagenginx: [emerg] open() "/var/run/nginx.pid" failed (13: Permission denied), in this case you have to add the linepid /tmp/nginx.pidinto your config.
nginxinc 命名空间的其他可用镜像:
nginxinc/nginx-unprivileged Related Documentation
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
轩辕镜像加速拉取命令点我查看更多 nginx-unprivileged 镜像标签
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务
