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

Commit f4befde

Browse files
drop support for centos6.10 + added docker-bench-security + linted with hadolint
1 parent 8cc747e commit f4befde

File tree

69 files changed

+354
-1402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+354
-1402
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: ./docker-build.sh alpine
22+
run: ./bin/docker-build.sh alpine
2323

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

3131
- name: Push images
32-
run: ./docker-push.sh alpine
32+
run: ./bin/docker-push.sh alpine
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: ./docker-build.sh amazonlinux
41+
run: ./bin/docker-build.sh amazonlinux
4242

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

5050
- name: Push images
51-
run: ./docker-push.sh amazonlinux
51+
run: ./bin/docker-push.sh amazonlinux
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: ./docker-build.sh centos
60+
run: ./bin/docker-build.sh centos
6161

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

6969
- name: Push images
70-
run: ./docker-push.sh centos
70+
run: ./bin/docker-push.sh centos
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: ./docker-build.sh debian
79+
run: ./bin/docker-build.sh debian
8080

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

8888
- name: Push images
89-
run: ./docker-push.sh debian
89+
run: ./bin/docker-push.sh debian
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: ./docker-build.sh fedora
98+
run: ./bin/docker-build.sh fedora
9999

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

107107
- name: Push images
108-
run: ./docker-push.sh fedora
108+
run: ./bin/docker-push.sh fedora
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: ./docker-build.sh ubuntu
117+
run: ./bin/docker-build.sh ubuntu
118118

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

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

README.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ Nginx 1.17, 1.18 and 1.19 with LUA support based on Alpine Linux, Amazon Linux,
3636
- [`1.19-debian9.12-slim`,`1.19.0-debian9.12-slim`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/debian/9.12-slim/Dockerfile)
3737
- [`1.19-debian8.11-slim`,`1.19.0-debian8.11-slim`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/debian/8.11-slim/Dockerfile)
3838
- [`1.19-centos7.8.2003`,`1.19.0-centos7.8.2003`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/centos/7.8.2003/Dockerfile)
39-
- [`1.19-centos6.10`,`1.19.0-centos6.10`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/centos/6.10/Dockerfile)
4039
- [`1.19-amazonlinux2018.03.0.20200318.1`,`1.19.0-amazonlinux2018.03.0.20200318.1`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/amazonlinux/2018.03.0.20200318.1/Dockerfile)
4140
- [`1.19-alpine3.11.6`,`1.19.0-alpine3.11.6`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/alpine/3.11.6/Dockerfile)
4241
- [`1.19-alpine3.10.5`,`1.19.0-alpine3.10.5`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.19.0/alpine/3.10.5/Dockerfile)
@@ -51,7 +50,6 @@ Nginx 1.17, 1.18 and 1.19 with LUA support based on Alpine Linux, Amazon Linux,
5150
- [`1.18-debian8.11-slim`,`1.18.0-debian8.11-slim`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/debian/8.11-slim/Dockerfile)
5251
- [`1.18-centos`,`1.18.0-centos`,`1.18-centos8.2.2004`,`1.18.0-centos8.2.2004`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/centos/8.2.2004/Dockerfile)
5352
- [`1.18-centos7.8.2003`,`1.18.0-centos7.8.2003`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/centos/7.8.2003/Dockerfile)
54-
- [`1.18-centos6.10`,`1.18.0-centos6.10`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/centos/6.10/Dockerfile)
5553
- [`1.18-amazonlinux`,`1.18.0-amazonlinux`,`1.18-amazonlinux2.0.20200406.0`,`1.18.0-amazonlinux2.0.20200406.0`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/amazonlinux/2.0.20200406.0/Dockerfile)
5654
- [`1.18-amazonlinux2018.03.0.20200318.1`,`1.18.0-amazonlinux2018.03.0.20200318.1`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/amazonlinux/2018.03.0.20200318.1/Dockerfile)
5755
- [`1.18-alpine`,`1.18.0-alpine`,`1.18-alpine3.12.0`,`1.18.0-alpine3.12.0`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.18.0/alpine/3.12.0/Dockerfile)
@@ -68,7 +66,6 @@ Nginx 1.17, 1.18 and 1.19 with LUA support based on Alpine Linux, Amazon Linux,
6866
- [`1.17-debian8.11-slim`,`1.17.10-debian8.11-slim`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/debian/8.11-slim/Dockerfile)
6967
- [`1.17-centos`,`1.17.10-centos`,`1.17-centos8.2.2004`,`1.17.10-centos8.2.2004`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/centos/8.2.2004/Dockerfile)
7068
- [`1.17-centos7.8.2003`,`1.17.10-centos7.8.2003`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/centos/7.8.2003/Dockerfile)
71-
- [`1.17-centos6.10`,`1.17.10-centos6.10`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/centos/6.10/Dockerfile)
7269
- [`1.17-amazonlinux`,`1.17.10-amazonlinux`,`1.17-amazonlinux2.0.20200406.0`,`1.17.10-amazonlinux2.0.20200406.0`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/amazonlinux/2.0.20200406.0/Dockerfile)
7370
- [`1.17-amazonlinux2018.03.0.20200318.1`,`1.17.10-amazonlinux2018.03.0.20200318.1`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/amazonlinux/2018.03.0.20200318.1/Dockerfile)
7471
- [`1.17-alpine`,`1.17.10-alpine`,`1.17-alpine3.12.0`,`1.17.10-alpine3.12.0`](https://github.com/fabiocicerchia/nginx-lua/blob/master/nginx/1.17.10/alpine/3.12.0/Dockerfile)
@@ -154,15 +151,6 @@ docker run -it --rm -p 80:80 \
154151
fabiocicerchia/nginx-lua:latest
155152
```
156153

157-
## User and group id
158-
159-
Images variants use the same user and group ids to drop the privileges for worker processes:
160-
161-
```console
162-
$ id
163-
uid=32548(nginx) gid=32548(nginx) groups=32548(nginx)
164-
```
165-
166154
## Image Variants
167155

168156
### `fabiocicerchia/nginx-lua:<version>`

docker-build.sh renamed to bin/docker-build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function build() {
2121
MINOR=$MAJOR.$(echo $NGINX_VER | cut -d '.' -f 2)
2222
PATCH=$NGINX_VER
2323

24-
if docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER; then
25-
return
26-
fi
24+
#if docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER; then
25+
# return
26+
#fi
2727

2828
TAGS="-t fabiocicerchia/nginx-lua:$PATCH-$OS$OS_VER"
2929
if [ "$VER_TAGS$OS_TAGS$DEFAULT" == "111" ]; then

docker-push.sh renamed to bin/docker-push.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function push() {
2121
MINOR=$MAJOR.$(echo $NGINX_VER | cut -d '.' -f 2)
2222
PATCH=$NGINX_VER
2323

24-
if docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER; then
25-
return
26-
fi
24+
#if docker_tag_exists fabiocicerchia/nginx-lua $PATCH-$OS$OS_VER; then
25+
# return
26+
#fi
2727

2828
docker push fabiocicerchia/nginx-lua:$MAJOR-$OS$OS_VER
2929
docker push fabiocicerchia/nginx-lua:$MINOR-$OS$OS_VER
File renamed without changes.

bin/generate_supported_versions.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/bin/bash
2+
3+
source supported_versions
4+
5+
VER_NGINX=$(DISTRO=nginx; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | egrep "\d+\.\d+\.\d+" | egrep -v "alpine|perl" | sort -Vr | head -n3)
6+
for VER in $VER_NGINX; do
7+
NGINX+=($VER)
8+
done
9+
10+
VER_ALPINE=$(DISTRO=alpine; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | egrep "\d+\.\d+\.\d+" | sort -Vr | head -n 3)
11+
for VER in $VER_ALPINE; do
12+
ALPINE+=($VER)
13+
done
14+
15+
VER_AMAZONLINUX=$(DISTRO=amazonlinux; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep "\." | egrep -v "with-sources|^201" | sort -V | head -n 3)
16+
for VER in $VER_AMAZONLINUX; do
17+
AMAZONLINUX+=($VER)
18+
done
19+
20+
VER_CENTOS=$(DISTRO=centos; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep "\." | grep -v centos | sort -Vr | head -n 3)
21+
for VER in $VER_CENTOS; do
22+
CENTOS+=($VER)
23+
done
24+
25+
VER_DEBIAN=$(DISTRO=debian; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep "\." | grep slim | sort -Vr | head -n 3)
26+
for VER in $VER_DEBIAN; do
27+
DEBIAN+=($VER)
28+
done
29+
30+
VER_FEDORA=$(DISTRO=fedora; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | sort -nr | head -n 3)
31+
for VER in $VER_FEDORA; do
32+
FEDORA+=($VER)
33+
done
34+
35+
VER_UBUNTU=$(DISTRO=ubuntu; wget -q https://registry.hub.docker.com/v1/repositories/$DISTRO/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep "\." | sort -nr | head -n 3)
36+
for VER in $VER_UBUNTU; do
37+
UBUNTU+=($VER)
38+
done
39+
40+
IFS=$'\n'
41+
NGINX=($(sort -Vu <<<"${NGINX[*]}"))
42+
ALPINE=($(sort -Vu <<<"${ALPINE[*]}"))
43+
AMAZONLINUX=($(sort -Vru <<<"${AMAZONLINUX[*]}"))
44+
CENTOS=($(sort -Vu <<<"${CENTOS[*]}"))
45+
DEBIAN=($(sort -Vu <<<"${DEBIAN[*]}"))
46+
FEDORA=($(sort -Vu <<<"${FEDORA[*]}"))
47+
UBUNTU=($(sort -Vu <<<"${UBUNTU[*]}"))
48+
unset IFS
49+
50+
echo "NGINX=(\"${NGINX[*]}\")" | sed 's/ /" "/g'
51+
echo "ALPINE=(\"${ALPINE[*]}\")" | sed 's/ /" "/g'
52+
echo "AMAZONLINUX=(\"${AMAZONLINUX[*]}\")" | sed 's/ /" "/g'
53+
echo "CENTOS=(\"${CENTOS[*]}\")" | sed 's/ /" "/g'
54+
echo "DEBIAN=(\"${DEBIAN[*]}\")" | sed 's/ /" "/g'
55+
echo "FEDORA=(\"${FEDORA[*]}\")" | sed 's/ /" "/g'
56+
echo "UBUNTU=(\"${UBUNTU[*]}\")" | sed 's/ /" "/g'
File renamed without changes.

bin/test-lint.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
for FILE in $(find nginx -type f); do
4+
docker run --rm -i hadolint/hadolint < $FILE || true
5+
done

test/security.sh renamed to bin/test-security.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ elif [ "$OS" == "fedora" ]; then VERSIONS=$FEDORA
3434
elif [ "$OS" == "ubuntu" ]; then VERSIONS=$UBUNTU
3535
fi
3636

37+
docker run -it --net host --pid host --userns host --cap-add audit_control \
38+
-e DOCKER_CONTENT_TRUST=$DOCKER_CONTENT_TRUST \
39+
-v /etc:/etc \
40+
-v /var/lib:/var/lib:ro \
41+
-v /var/run/docker.sock:/var/run/docker.sock:ro \
42+
--label docker_bench_security \
43+
docker/docker-bench-security
44+
3745
NLEN=${#NGINX[@]}
3846
for (( I=0; I<$NLEN; I++ )); do
3947
NGINX_VER="${NGINX[$I]}"
File renamed without changes.

0 commit comments

Comments
 (0)