Skip to content

Latest commit

 

History

History

nginx

nginx

static build nginx

nginx version 1.25.3

Usage

FROM suconghou/nginx
ADD . .
RUN cp nginx.conf /etc/nginx/nginx.conf
EXPOSE 80 443
CMD ["nginx", "-g", "daemon off;"]

Dockerfile

https://github.com/suconghou/docker/tree/master/nginx

Docker image https://hub.docker.com/r/suconghou/nginx/

static build

在运行 make之前

修改objs/Makefile文件, 搜索link关键字, 在 link objs/nginx 的时候补充上 -static参数静态编译

objs/ngx_modules.o -static \

for nginx:busybox can be run use nginx -g "user root root;"

因为 busybox 里面没有nobody组,执行addgroup nobody添加组后也可以直接运行。

http3

参考

https://github.com/patrikjuvonen/docker-nginx-http3

去除部分扩展 改为静态编译