Skip to content

Commit 9a4945b

Browse files
committed
docs: update docs
1 parent 143bda7 commit 9a4945b

File tree

2 files changed

+44
-4
lines changed

2 files changed

+44
-4
lines changed

README.md

+44-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,52 @@
11
# Nginx Docker Playground
22

3-
Nginx Development Environment based on official docker image.
3+
<img src="assets/logo.png" with="130" height="130" />
44

5-
## Docker Image Name
5+
Nginx Development Environment based on official docker image and official source code.
66

7-
`docker pull soulteary/prebuilt-nginx-modules:base-1.21.6`
7+
## Quick Start
88

9-
## Nginx Versions
9+
```bash
10+
docker pull soulteary/prebuilt-nginx-modules:base-1.21.6
11+
```
12+
13+
Example, how to quickly build a nginx addon:
14+
15+
```docker
16+
# @see https://github.com/nginx-with-docker/ngx_http_srcache_filter_module/blob/main/docker/0.32/Dockerfile.alpine
17+
18+
ARG NGINX_VERSION=1.19.7
19+
FROM soulteary/prebuilt-nginx-modules:base-${NGINX_VERSION}-alpine AS Builder
20+
21+
ARG MODULE_CHECKSUM=127181f371046cc5ec0e0acf1b45cd478a8a7a5f
22+
ARG MODULE_VERSION=0.32
23+
ARG MODULE_NAME=srcache-nginx-module-src
24+
ARG MODULE_SOURCE=https://github.com/nginx-with-docker/srcache-nginx-module-src
25+
26+
RUN cd /usr/src && \
27+
curl -L "${MODULE_SOURCE}/archive/refs/tags/v${MODULE_VERSION}.tar.gz" -o "${MODULE_VERSION}.tar.gz" && \
28+
echo "${MODULE_CHECKSUM} ${MODULE_VERSION}.tar.gz" | shasum -c && \
29+
tar -zxC /usr/src -f ${MODULE_VERSION}.tar.gz && \
30+
cd /usr/src && \
31+
mv ${MODULE_NAME}-${MODULE_VERSION}/ ${MODULE_NAME} && \
32+
cd /usr/src/nginx && \
33+
CONFARGS=$(nginx -V 2>&1 | sed -n -e 's/^.*arguments: //p') \
34+
CONFARGS=${CONFARGS/-Os -fomit-frame-pointer -g/-Os} && \
35+
echo $CONFARGS && \
36+
./configure --with-compat $CONFARGS --add-dynamic-module=../${MODULE_NAME}/ && \
37+
make modules
38+
39+
FROM scratch
40+
41+
COPY --from=Builder /usr/src/nginx/objs/ngx_http_srcache_filter_module.so /
42+
```
43+
44+
## Pre-built Nginx Addons
45+
46+
Pre-built nginx addons binaries based on this project
47+
- https://github.com/nginx-with-docker/prebuilt-nginx-modules
48+
49+
## Support Nginx Versions
1050

1151
Below are other available nginx versions.
1252

assets/logo.png

12.2 KB
Loading

0 commit comments

Comments
 (0)