Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆ Upgrade Nginx to the latest version of the official images #107

Merged
merged 3 commits into from
Sep 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: Install poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
- name: Configure poetry
run: python -m poetry config virtualenvs.create false
- name: Install Dependencies
run: python3.7 -m pip install docker pytest
run: python -m poetry install
- name: Test Image
run: bash scripts/test.sh
run: python -m poetry run bash scripts/test.sh
env:
NAME: ${{ matrix.image.name }}
DOCKERFILE: ${{ matrix.image.dockerfile }}
Expand Down
9 changes: 5 additions & 4 deletions docker-images/install-nginx-alpine.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# From official Nginx Docker image, as a script to re-use it, removing internal comments

# Standard set up Nginx Alpine
# https://github.com/nginxinc/docker-nginx/blob/594ce7a8bc26c85af88495ac94d5cd0096b306f7/mainline/alpine/Dockerfile
# https://github.com/nginxinc/docker-nginx/blob/f958fbacada447737319e979db45a1da49123142/mainline/alpine/Dockerfile

export NGINX_VERSION=1.17.10
export NJS_VERSION=0.3.9
export NGINX_VERSION=1.21.1
export NJS_VERSION=0.6.1
export PKG_RELEASE=1

set -x \
Expand All @@ -19,7 +19,7 @@ set -x \
nginx-module-njs=${NGINX_VERSION}.${NJS_VERSION}-r${PKG_RELEASE} \
" \
&& case "$apkArch" in \
x86_64) \
x86_64|aarch64) \
set -x \
&& KEY_SHA512="e7fa8303923d9b95db37a77ad46c68fd4755ff935d0a534d26eba83de193c76166c68bfe7f65471bf8881004ef4aa6df3e34689c305662750c0172fca5d8552a *stdin" \
&& apk add --no-cache --virtual .cert-deps \
Expand Down Expand Up @@ -89,6 +89,7 @@ set -x \
&& apk del .gettext \
&& mv /tmp/envsubst /usr/local/bin/ \
&& apk add --no-cache tzdata \
&& apk add --no-cache curl ca-certificates \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

Expand Down
21 changes: 10 additions & 11 deletions docker-images/install-nginx-debian.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#! /usr/bin/env bash

# From official Nginx Docker image, as a script to re-use it, removing internal comments
# Ref: https://github.com/nginxinc/docker-nginx/blob/594ce7a8bc26c85af88495ac94d5cd0096b306f7/mainline/buster/Dockerfile
# Ref: https://github.com/nginxinc/docker-nginx/blob/f958fbacada447737319e979db45a1da49123142/mainline/debian/Dockerfile

# Standard set up Nginx
export NGINX_VERSION=1.17.10
export NJS_VERSION=0.3.9
export NGINX_VERSION=1.21.1
export NJS_VERSION=0.6.1
export PKG_RELEASE=1~buster

set -x \
Expand All @@ -31,10 +31,10 @@ set -x \
nginx-module-xslt=${NGINX_VERSION}-${PKG_RELEASE} \
nginx-module-geoip=${NGINX_VERSION}-${PKG_RELEASE} \
nginx-module-image-filter=${NGINX_VERSION}-${PKG_RELEASE} \
nginx-module-njs=${NGINX_VERSION}.${NJS_VERSION}-${PKG_RELEASE} \
nginx-module-njs=${NGINX_VERSION}+${NJS_VERSION}-${PKG_RELEASE} \
" \
&& case "$dpkgArch" in \
amd64|i386) \
amd64|i386|arm64) \
echo "deb https://nginx.org/packages/mainline/debian/ buster nginx" >> /etc/apt/sources.list.d/nginx.list \
&& apt-get update \
;; \
Expand Down Expand Up @@ -68,14 +68,13 @@ set -x \
&& apt-get install --no-install-recommends --no-install-suggests -y \
$nginxPackages \
gettext-base \
&& apt-get remove --purge --auto-remove -y ca-certificates && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list \
curl \
&& apt-get remove --purge --auto-remove -y && rm -rf /var/lib/apt/lists/* /etc/apt/sources.list.d/nginx.list \
\
&& if [ -n "$tempDir" ]; then \
apt-get purge -y --auto-remove \
&& rm -rf "$tempDir" /etc/apt/sources.list.d/temp.list; \
fi

# forward request and error logs to docker log collector
ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
fi \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log \
# Standard set up Nginx finished
  NODES
COMMUNITY 2
INTERN 2
Note 1
Project 4
USERS 1