本镜像复制自 nginxinc/nginx-unprivileged 镜像,专门用于 Sumo Logic Kubernetes Collection 组件,作为其数据采集流程中的辅助服务。镜像保持了原非特权 NGINX 的核心特性,通过非 root 用户运行 NGINX 进程,以满足 Kubernetes 环境下的安全合规要求,同时为 Sumo Logic 采集器提供轻量级的 HTTP 服务能力(如反向代理、静态资源托管、请求转发等)。
本镜像主要适用于 Kubernetes 集群环境中,作为 Sumo Logic Kubernetes Collection 的辅助组件,典型使用场景包括:
通过 docker run 命令可直接启动镜像,基本示例如下:
bashdocker run -d \ --name sumologic-nginx-unprivileged \ -p 8080:8080 \ # 非特权镜像默认使用 8080 端口(替代 root 镜像的 80 端口) -v $(pwd)/nginx.conf:/etc/nginx/nginx.conf:ro \ # 挂载自定义 NGINX 配置文件 sumologic/nginx-unprivileged # 假设镜像名称为 sumologic/nginx-unprivileged(具体以实际为准)
在 Kubernetes 环境中,通常作为 Sumo Logic 采集器 Pod 的 sidecar 容器运行,示例 Deployment 片段如下:
yamlapiVersion: apps/v1 kind: Deployment metadata: name: sumologic-collector namespace: sumologic spec: template: spec: containers: - name: nginx-unprivileged image: sumologic/nginx-unprivileged # 本镜像 ports: - containerPort: 8080 # 非特权端口 volumeMounts: - name: nginx-config mountPath: /etc/nginx/nginx.conf subPath: nginx.conf - name: nginx-logs mountPath: /var/log/nginx # 日志挂载至持久化存储或日志采集路径 securityContext: runAsUser: 101 # 匹配镜像默认非特权用户 UID runAsGroup: 101 allowPrivilegeEscalation: false volumes: - name: nginx-config configMap: name: sumologic-nginx-config # 包含 NGINX 配置的 ConfigMap - name: nginx-logs emptyDir: {} # 或使用持久卷
本镜像支持通过环境变量调整 NGINX 运行参数(基于 nginxinc/nginx-unprivileged 特性):
| 环境变量 | 描述 | 默认值 |
|---|---|---|
NGINX_HTTP_PORT | HTTP 服务监听端口(非特权端口,>1024) | 8080 |
NGINX_HTTPS_PORT | HTTPS 服务监听端口(非特权端口) | 8443 |
NGINX_USER | 运行 NGINX 的用户 UID | 101 |
NGINX_GROUP | 运行 NGINX 的用户组 GID | 101 |
NGINX_LOG_DIR | 日志文件存储路径 | /var/log/nginx |
NGINX 配置可通过挂载自定义 nginx.conf 或配置片段实现。例如,为 Sumo Logic 采集器配置反向代理规则:
nginx# 自定义 nginx.conf 示例(用于转发采集器 API 请求) worker_processes auto; events { worker_connections 1024; } http { server { listen 8080; # 匹配环境变量 NGINX_HTTP_PORT server_name sumologic-collector-proxy; location /metrics { proxy_pass [***] # 转发至采集器 metrics 端点 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } }
挂载该配置文件至容器:
bashdocker run -d \ -v $(pwd)/custom-nginx.conf:/etc/nginx/nginx.conf:ro \ sumologic/nginx-unprivileged
101(默认),挂载宿主机目录时需确保该用户有读/写权限。来自真实用户的反馈,见证轩辕镜像的优质服务
免费版仅支持 Docker Hub 加速,不承诺可用性和速度;专业版支持更多镜像源,保证可用性和稳定速度,提供优先客服响应。
免费版仅支持 docker.io;专业版支持 docker.io、gcr.io、ghcr.io、registry.k8s.io、nvcr.io、quay.io、mcr.microsoft.com、docker.elastic.co 等。
当返回 402 Payment Required 错误时,表示流量已耗尽,需要充值流量包以恢复服务。
通常由 Docker 版本过低导致,需要升级到 20.x 或更高版本以支持 V2 协议。
先检查 Docker 版本,版本过低则升级;版本正常则验证镜像信息是否正确。
使用 docker tag 命令为镜像打上新标签,去掉域名前缀,使镜像名称更简洁。
探索更多轩辕镜像的使用方法,找到最适合您系统的配置方式
通过 Docker 登录认证访问私有仓库
在 Linux 系统配置镜像加速服务
在 Docker Desktop 配置镜像加速
Docker Compose 项目配置加速
Kubernetes 集群配置 Containerd
在宝塔面板一键配置镜像加速
Synology 群晖 NAS 配置加速
飞牛 fnOS 系统配置镜像加速
极空间 NAS 系统配置加速服务
爱快 iKuai 路由系统配置加速
绿联 NAS 系统配置镜像加速
QNAP 威联通 NAS 配置加速
Podman 容器引擎配置加速
HPC 科学计算容器配置加速
ghcr、Quay、nvcr 等镜像仓库
无需登录使用专属域名加速
需要其他帮助?请查看我们的 常见问题 或 官方QQ群: 13763429