Skip to content

Commit

Permalink
Add support for Ubuntu 22.04 (#10)
Browse files Browse the repository at this point in the history
Add support for Ubuntu 22.04
  • Loading branch information
DimitriosLisenko committed Nov 9, 2022
1 parent 3ce0c1b commit ab55815
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ ARG INCLUDE_PASSENGER_ENTERPRISE=*passed-in*
ARG NGINX_VERSION=*passed-in*
ARG PASSENGER_VERSION=*passed-in*
ARG RELEASE_VERSION=*passed-in*
ARG OPENSSL_VERSION=*passed-in*

# NOTE: these are updated as required (build dependencies)
ARG AUTOMAKE_VERSION=1.16.4
ARG OPENSSL_VERSION=1.1.1l
ARG PCRE_VERSION=8.45
ARG ZLIB_VERSION=1.2.11
ARG LIBGD_VERSION=2.3.3
Expand Down Expand Up @@ -66,9 +66,8 @@ RUN mkdir -p /usr/local/debs

RUN apt-get update &&\
apt-get install -y software-properties-common &&\
apt-add-repository ppa:brightbox/ruby-ng &&\
apt-get update &&\
apt-get install -y apt-utils autoconf build-essential curl git libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpam0g-dev libpcre++-dev libperl-dev libtool libxml2-dev libxslt-dev libyajl-dev pkgconf ruby-dev ruby2.7 ruby2.7-dev vim wget zlib1g-dev
apt-get install -y apt-utils autoconf build-essential curl git libcurl4-openssl-dev libgeoip-dev liblmdb-dev libpam0g-dev libpcre++-dev libperl-dev libtool libxml2-dev libxslt-dev libyajl-dev pkgconf ruby-full ruby-dev vim wget zlib1g-dev

# NGINX seems to require a specific version of automake, but only sometimes...
RUN wget https://ftp.gnu.org/gnu/automake/automake-${AUTOMAKE_VERSION}.tar.gz -P /usr/local/sources &&\
Expand Down Expand Up @@ -474,7 +473,7 @@ RUN wget https://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz -P /usr/local/
RUN wget https://github.com/matsumotory/ngx_mruby/archive/refs/tags/v${NGX_MRUBY_VERSION}.tar.gz -P /usr/local/sources &&\
tar zxf /usr/local/sources/v${NGX_MRUBY_VERSION}.tar.gz &&\
cd ngx_mruby-${NGX_MRUBY_VERSION} &&\
./configure --with-ngx-src-root=/usr/local/build/nginx-${NGINX_VERSION} --with-ngx-config-opt='${NGINX_CONFIGURE_OPTIONS_WITHOUT_MODULES' --with-openssl-src=/usr/local/build/openssl-${OPENSSL_VERSION} &&\
./configure --with-ngx-src-root=/usr/local/build/nginx-${NGINX_VERSION} --with-ngx-config-opt='${NGINX_CONFIGURE_OPTIONS_WITHOUT_MODULES' &&\
make build_mruby &&\
make generate_gems_config

Expand Down
7 changes: 3 additions & 4 deletions bulk-generate.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env ruby
require 'date'
RELEASE_VERSION = ARGV[0]
#OS_VERSIONS = %w(18.04)
OS_VERSIONS = %w(18.04 20.04)
NGINX_VERSIONS = %w(1.22.0)
PASSENGER_VERSIONS = %w(6.0.14)
OS_VERSIONS = %w(18.04 20.04 22.04)
NGINX_VERSIONS = %w(1.22.1)
PASSENGER_VERSIONS = %w(6.0.15)

raise "Must provide release number as first argument" if RELEASE_VERSION.nil?

Expand Down
8 changes: 7 additions & 1 deletion compile_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ fi
case $1 in
18.04)
OPERATING_SYSTEM_CODENAME=bionic
OPENSSL_VERSION=1.1.1s
;;
20.04)
OPERATING_SYSTEM_CODENAME=focal
OPENSSL_VERSION=1.1.1s
;;
22.04)
OPERATING_SYSTEM_CODENAME=jammy
OPENSSL_VERSION=3.0.7
;;
*)
echo "Unknown operating system"
Expand All @@ -42,4 +48,4 @@ tag="cloud66-nginx:ubuntu-$1-nginx-$2-passenger-$3-release-$4"
# remove previous build
docker rmi --force $tag >/dev/null 2>&1
# build new version
docker build --rm --build-arg OPERATING_SYSTEM_VERSION=$1 --build-arg OPERATING_SYSTEM_CODENAME=$OPERATING_SYSTEM_CODENAME --build-arg NGINX_VERSION=$2 --build-arg PASSENGER_VERSION=$3 --build-arg RELEASE_VERSION=$4 --build-arg INCLUDE_PASSENGER_ENTERPRISE=$INCLUDE_PASSENGER_ENTERPRISE --tag $tag . >$build_log_file 2>&1
docker build --rm --build-arg OPERATING_SYSTEM_VERSION=$1 --build-arg OPERATING_SYSTEM_CODENAME=$OPERATING_SYSTEM_CODENAME --build-arg NGINX_VERSION=$2 --build-arg PASSENGER_VERSION=$3 --build-arg RELEASE_VERSION=$4 --build-arg INCLUDE_PASSENGER_ENTERPRISE=$INCLUDE_PASSENGER_ENTERPRISE --build-arg OPENSSL_VERSION=$OPENSSL_VERSION --tag $tag . >$build_log_file 2>&1
8 changes: 8 additions & 0 deletions test_nginx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ set -e
echo "Checking NGINX version"
nginx -V

# this test may fail if the system OpenSSL is the same as the OpenSSL that NGINX was built with but it's very unlikely to happen
echo "Testing NGINX is using system OpenSSL"
nginx -V 2>&1 | grep "running with OpenSSL"

# this test is not foolproof - I previously accidentally statically compiled NGINX and something was still using libssl from the system
echo "Ensuring that OpenSSL is dynamically linked"
ldd $(which nginx) | grep libssl

echo "Testing NGINX configuration"
nginx -t

Expand Down

0 comments on commit ab55815

Please sign in to comment.