Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit dba463d

Browse files
improved readme + fixed labels + minor fixes
1 parent 022c368 commit dba463d

File tree

23 files changed

+315
-110
lines changed

23 files changed

+315
-110
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- uses: actions/checkout@v2
2020

2121
- name: Build images
22-
run: ./bin/docker-build.sh alpine
22+
run: ./bin/docker-build.sh alpine 1
2323

2424
- name: Test images
2525
run: ./bin/test.sh alpine
@@ -29,7 +29,7 @@ jobs:
2929
if: github.ref == 'refs/heads/master'
3030

3131
- name: Push images
32-
run: ./bin/docker-push.sh alpine
32+
run: ./bin/docker-push.sh alpine 1
3333
if: github.ref == 'refs/heads/master'
3434

3535
docker_amazonlinux:
@@ -38,7 +38,7 @@ jobs:
3838
- uses: actions/checkout@v2
3939

4040
- name: Build images
41-
run: ./bin/docker-build.sh amazonlinux
41+
run: ./bin/docker-build.sh amazonlinux 1
4242

4343
- name: Test images
4444
run: ./bin/test.sh amazonlinux
@@ -48,7 +48,7 @@ jobs:
4848
if: github.ref == 'refs/heads/master'
4949

5050
- name: Push images
51-
run: ./bin/docker-push.sh amazonlinux
51+
run: ./bin/docker-push.sh amazonlinux 1
5252
if: github.ref == 'refs/heads/master'
5353

5454
docker_centos:
@@ -57,7 +57,7 @@ jobs:
5757
- uses: actions/checkout@v2
5858

5959
- name: Build images
60-
run: ./bin/docker-build.sh centos
60+
run: ./bin/docker-build.sh centos 1
6161

6262
- name: Test images
6363
run: ./bin/test.sh centos
@@ -67,7 +67,7 @@ jobs:
6767
if: github.ref == 'refs/heads/master'
6868

6969
- name: Push images
70-
run: ./bin/docker-push.sh centos
70+
run: ./bin/docker-push.sh centos 1
7171
if: github.ref == 'refs/heads/master'
7272

7373
docker_debian:
@@ -76,7 +76,7 @@ jobs:
7676
- uses: actions/checkout@v2
7777

7878
- name: Build images
79-
run: ./bin/docker-build.sh debian
79+
run: ./bin/docker-build.sh debian 1
8080

8181
- name: Test images
8282
run: ./bin/test.sh debian
@@ -86,7 +86,7 @@ jobs:
8686
if: github.ref == 'refs/heads/master'
8787

8888
- name: Push images
89-
run: ./bin/docker-push.sh debian
89+
run: ./bin/docker-push.sh debian 1
9090
if: github.ref == 'refs/heads/master'
9191

9292
docker_fedora:
@@ -95,7 +95,7 @@ jobs:
9595
- uses: actions/checkout@v2
9696

9797
- name: Build images
98-
run: ./bin/docker-build.sh fedora
98+
run: ./bin/docker-build.sh fedora 1
9999

100100
- name: Test images
101101
run: ./bin/test.sh fedora
@@ -105,7 +105,7 @@ jobs:
105105
if: github.ref == 'refs/heads/master'
106106

107107
- name: Push images
108-
run: ./bin/docker-push.sh fedora
108+
run: ./bin/docker-push.sh fedora 1
109109
if: github.ref == 'refs/heads/master'
110110

111111
docker_ubuntu:
@@ -114,7 +114,7 @@ jobs:
114114
- uses: actions/checkout@v2
115115

116116
- name: Build images
117-
run: ./bin/docker-build.sh ubuntu
117+
run: ./bin/docker-build.sh ubuntu 1
118118

119119
- name: Test images
120120
run: ./bin/test.sh ubuntu
@@ -124,5 +124,5 @@ jobs:
124124
if: github.ref == 'refs/heads/master'
125125

126126
- name: Push images
127-
run: ./bin/docker-push.sh ubuntu
127+
run: ./bin/docker-push.sh ubuntu 1
128128
if: github.ref == 'refs/heads/master'

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nginx/1.19.0/alpine/3.12.0/Dockerfile

README.md

Lines changed: 100 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,63 @@ Lua is a lightweight, high-level, multi-paradigm programming language designed p
9999

100100
### Compiled Version Details
101101

102-
```console
103-
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --add-module=/lua-nginx-module-0.10.15 --add-module=/ngx_devel_kit-0.3.1 --with-http_dav_module --with-http_geoip_module
102+
```bash
103+
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --user=nginx --group=nginx --add-module=/lua-nginx-module-0.10.15 --add-module=/ngx_devel_kit-0.3.1 --with-compat --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads --with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-rpath,/usr/local/lib -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie'
104104
```
105105

106+
The following are the available build-time options. They can be set using the `--build-arg` CLI argument.
107+
108+
| Key | Default | Description |
109+
:----- | :-----: |:----------- |
110+
| DOCKER_IMAGE | fabiocicerchia/nginx-lua | |
111+
| DOCKER_IMAGE_OS | alpine | The Docker image base to build `FROM`. |
112+
| DOCKER_IMAGE_TAG | 3.12.0 | The Docker image tag to build `FROM`. |
113+
| VER_LUAJIT | 2.1-20200102 | The version of LuaJIT to use. |
114+
| VER_LUA_NGINX_MODULE | 0.10.15 | The version of ngx_http_lua_module to use. |
115+
| VER_LUA_RESTY_CORE | 0.1.17 | The version of lua-resty-core to use. |
116+
| LUA_LIB_DIR | /usr/local/share/lua/5.1 | Path to Lua library directory. |
117+
| VER_LUA_RESTY_LRUCACHE | 0.09 | The version of lua-resty-lrucache to use. |
118+
| VER_NGX_DEVEL_KIT | 0.3.1 | The version of Nginx Development Kit to use. |
119+
| VER_NGINX | 1.19.0 | The version of nginx to use. |
120+
| NGINX_BUILD_CONFIG | --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --user=nginx --group=nginx --add-module=/lua-nginx-module-${VER_LUA_NGINX_MODULE} --add-module=/ngx_devel_kit-${VER_NGX_DEVEL_KIT} --with-compat --with-file-aio --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_dav_module --with-http_flv_module --with-http_geoip_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-threads | Options to pass to nginx's `./configure` script. |
121+
| LUAJIT_LIB | /usr/local/lib | Tell nginx's build system where to find LuaJIT 2.0 |
122+
| LUAJIT_INC | /usr/local/include/luajit-2.1 | Tell nginx's build system where to find LuaJIT 2.0 |
123+
| LD_LIBRARY_PATH | /usr/local/lib/:$LD_LIBRARY_PATH | Search path environment variable for the linux shared library. |
124+
| BUILD_DEPS | Differs based on the distro | List of needed packages to build properly the software. |
125+
| NGINX_BUILD_DEPS | Differs based on the distro | List of needed packages to build properly nginx. |
126+
| BUILD_DATE | This label contains the Date/Time the image was built. |
127+
| VCS_REF | Identifier for the version of the source code from which this image was built. |
128+
| VER_DUMBINIT | 1.2.2 | The version of dumb-init to use. |
129+
| PKG_DEPS | Differs based on the distro | List of needed packages to run properly the software. |
130+
131+
These built-from-source flavors include the following modules by default, but one can easily increase or decrease that with the custom build options above:
132+
133+
- file-aio
134+
- http_addition_module
135+
- http_auth_request_module
136+
- http_dav_module
137+
- http_dav_module
138+
- http_flv_module
139+
- http_geoip_module
140+
- http_gunzip_module
141+
- http_gzip_static_module
142+
- http_mp4_module
143+
- http_random_index_module
144+
- http_realip_module
145+
- http_secure_link_module
146+
- http_slice_module
147+
- http_ssl_module
148+
- http_stub_status_module
149+
- http_sub_module
150+
- http_v2_module
151+
- mail
152+
- mail_ssl_module
153+
- stream
154+
- stream_realip_module
155+
- stream_ssl_module
156+
- stream_ssl_preread_module
157+
- thread
158+
106159
## Run Container
107160

108161
```bash
@@ -124,7 +177,41 @@ Provides Nginx + LUA. Uses Alpine, Amazon Linux, CentOS, Debian, Fedora, Ubuntu
124177
### `fabiocicerchia/nginx-lua:<version>-<distro><version>`
125178
Provides Nginx + LUA. Uses pinned version for Alpine, Amazon Linux, CentOS, Debian, Fedora, Ubuntu for base image.
126179

127-
## Example
180+
## Image Labels
181+
182+
The image builds are labeled with various information. Here's an example of printing the labels using jq:
183+
184+
```bash
185+
$ docker pull fabiocicerchia/nginx-lua:1-alpine
186+
$ docker inspect fabiocicerchia/nginx-lua:1-alpine | jq '.[].Config.Labels'
187+
{
188+
"maintainer": "Fabio Cicerchia <[email protected]>",
189+
"org.label-schema.build-date": "2020-06-27T20:53:15Z",
190+
"org.label-schema.description": "Nginx 1.19.0 with LUA support based on alpine 3.12.0.",
191+
"org.label-schema.docker.cmd": "docker run -p 80:80 -d fabiocicerchia/nginx-lua:1.19.0-alpine3.12.0",
192+
"org.label-schema.name": "fabiocicerchia/nginx-lua",
193+
"org.label-schema.schema-version": "1.0",
194+
"org.label-schema.url": "https://github.com/fabiocicerchia/nginx-lua",
195+
"org.label-schema.vcs-ref": "5b8a255",
196+
"org.label-schema.vcs-url": "https://github.com/fabiocicerchia/nginx-lua",
197+
"org.label-schema.version": "1.19.0-alpine3.12.0"
198+
}
199+
```
200+
201+
| Label Name | Description |
202+
:----------------------------------- |:----------------------- |
203+
| `maintainer` | Maintainer of the image |
204+
| `org.label-schema.build-date` | This label contains the Date/Time the image was built. The value SHOULD be formatted according to RFC 3339. buildarg `BUILD_DATE` |
205+
| `org.label-schema.description` | Text description of the image. May contain up to 300 characters. |
206+
| `org.label-schema.docker.cmd` | How to run a container based on the image under the Docker runtime. |
207+
| `org.label-schema.name` | buildarg `DOCKER_IMAGE` |
208+
| `org.label-schema.schema-version` | This label SHOULD be present to indicate the version of Label Schema in use. |
209+
| `org.label-schema.url` | URL of website with more information about the product or service provided by the container. |
210+
| `org.label-schema.vcs-ref` | buildarg `VCS_REF` |
211+
| `org.label-schema.vcs-url` | URL for the source code under version control from which this container image was built. |
212+
| `org.label-schema.version` | Release identifier for the contents of the image. |
213+
214+
## Examples
128215

129216
### Virtual Host
130217

@@ -165,6 +252,16 @@ services:
165252
166253
# License
167254
255+
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
256+
257+
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
258+
259+
- [Nginx License](https://nginx.org/LICENSE)
260+
- [Lua License](https://www.lua.org/license.html)
261+
- [OpenResty License](https://github.com/openresty/openresty#copyright--license)
262+
263+
## `fabiocicerchia/nginx-lua`
264+
168265
MIT License
169266

170267
Copyright (c) 2020 Fabio Cicerchia <[email protected]>

bin/docker-build.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source supported_versions
44

55
function docker_tag_exists() {
66
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
7+
echo $?
78
}
89

910
function build() {
@@ -21,9 +22,9 @@ function build() {
2122
MINOR=$MAJOR.$(echo $NGINX_VER | cut -d '.' -f 2)
2223
PATCH=$NGINX_VER
2324

24-
#if docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER; then
25-
# return
26-
#fi
25+
if [ "$FORCE" == "0" -a $(docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER) == 0 ]; then
26+
return
27+
fi
2728

2829
TAGS=""
2930
if [ "$VER_TAGS$OS_TAGS$DEFAULT" == "111" ]; then
@@ -48,11 +49,9 @@ function build() {
4849
TAGS="$TAGS -t fabiocicerchia/nginx-lua:$MAJOR-$OS$OS_VER"
4950

5051
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
51-
BUILD_VERSION=$(date +%s)
5252
VCS_REF=$(git rev-parse --short HEAD)
5353
time docker build \
5454
--build-arg BUILD_DATE=$BUILD_DATE \
55-
--build-arg BUILD_VERSION=$BUILD_VERSION \
5655
--build-arg VCS_REF=$VCS_REF \
5756
$TAGS \
5857
-f $DOCKERFILE .
@@ -61,6 +60,10 @@ function build() {
6160
set -x
6261

6362
OS=$1
63+
FORCE=0
64+
if [ "$2" == "1" ]; then
65+
FORCE=1
66+
fi
6467
VERSIONS=()
6568
if [ "$OS" == "alpine" ]; then VERSIONS=("${ALPINE[@]}")
6669
elif [ "$OS" == "amazonlinux" ]; then VERSIONS=("${AMAZONLINUX[@]}")

bin/docker-push.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ source supported_versions
44

55
function docker_tag_exists() {
66
curl --silent -f -lSL https://index.docker.io/v1/repositories/$1/tags/$2 > /dev/null
7+
echo $?
78
}
89

910
function push() {
@@ -21,9 +22,9 @@ function push() {
2122
MINOR=$MAJOR.$(echo $NGINX_VER | cut -d '.' -f 2)
2223
PATCH=$NGINX_VER
2324

24-
#if docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER; then
25-
# return
26-
#fi
25+
if [ "$FORCE" == "0" -a $(docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER) == 0 ]; then
26+
return
27+
fi
2728

2829
docker push fabiocicerchia/nginx-lua:$MAJOR-$OS$OS_VER
2930
docker push fabiocicerchia/nginx-lua:$MINOR-$OS$OS_VER
@@ -50,6 +51,10 @@ function push() {
5051
set -x
5152

5253
OS=$1
54+
FORCE=0
55+
if [ "$2" == "1" ]; then
56+
FORCE=1
57+
fi
5358
VERSIONS=()
5459
if [ "$OS" == "alpine" ]; then VERSIONS=$ALPINE
5560
elif [ "$OS" == "amazonlinux" ]; then VERSIONS=$AMAZONLINUX

nginx/1.19.0/alpine/3.11.6/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ ARG DOCKER_IMAGE_TAG=3.11.6
77
####################################
88
FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG AS builder
99

10-
ARG BUILD_DATE
11-
ARG BUILD_VERSION
12-
ARG VCS_REF
13-
1410
# https://github.com/openresty/luajit2
1511
ARG VER_LUAJIT=2.1-20200102
1612

@@ -178,6 +174,13 @@ RUN set -eux \
178174
##########################################
179175
FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG
180176

177+
ARG DOCKER_IMAGE=fabiocicerchia/nginx-lua
178+
ARG DOCKER_IMAGE_OS=alpine
179+
ARG DOCKER_IMAGE_TAG=3.11.6
180+
ARG VER_NGINX=1.19.0
181+
ARG BUILD_DATE
182+
ARG VCS_REF
183+
181184
# http://label-schema.org/rc1/
182185
LABEL maintainer="Fabio Cicerchia <[email protected]>" \
183186
org.label-schema.build-date=$BUILD_DATE \

nginx/1.19.0/alpine/3.12.0/Dockerfile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ ARG DOCKER_IMAGE_TAG=3.12.0
77
####################################
88
FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG AS builder
99

10-
ARG BUILD_DATE
11-
ARG BUILD_VERSION
12-
ARG VCS_REF
13-
1410
# https://github.com/openresty/luajit2
1511
ARG VER_LUAJIT=2.1-20200102
1612

@@ -178,6 +174,13 @@ RUN set -eux \
178174
##########################################
179175
FROM $DOCKER_IMAGE_OS:$DOCKER_IMAGE_TAG
180176

177+
ARG DOCKER_IMAGE=fabiocicerchia/nginx-lua
178+
ARG DOCKER_IMAGE_OS=alpine
179+
ARG DOCKER_IMAGE_TAG=3.12.0
180+
ARG VER_NGINX=1.19.0
181+
ARG BUILD_DATE
182+
ARG VCS_REF
183+
181184
# http://label-schema.org/rc1/
182185
LABEL maintainer="Fabio Cicerchia <[email protected]>" \
183186
org.label-schema.build-date=$BUILD_DATE \

0 commit comments

Comments
 (0)