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

feat(ETHOS-36876): Add new Ubuntu 22.04, Replace nginx installation, Add njs module (ubuntu only) #85

Merged
merged 9 commits into from
Aug 5, 2022

Conversation

adobejmong
Copy link
Collaborator

@adobejmong adobejmong commented Jul 15, 2022

What changed?

Major Changes

  • Add new base from Ubuntu 20.04 (docker-base:5.0.1-ubuntu-20.04) to Ubuntu 22.04 (docker-base:5.1.0-ubuntu-22.04). Will eventually make this the default
  • Removed previous nginx installation from ppa:ondrej/nginx and software-properties-common
  • Removed curl, gnupg2 if installed
  • Added new install nginx script scripts/install_nginx.sh, from standard nginx install: http://nginx.org/en/linux_packages.html#Ubuntu
  • Added new install njs module script scripts/install_njs.sh to install nginx-module-njs module. See ETHOS-36876 @kmashint - https://nginx.org/en/docs/njs/
  • Added new cleanup script scripts/cleanup.sh to purge unnecessary packages in final image
  • Added SERVER_ENABLE_NGX_HTTP_JS. If set to true, it will enable i.e. load_module the nginx njs module
  • Updated Ubuntu Dockerfile to use multi-stage builds

Bug Fixes

  • Fix duplicate extension warning due to grep -x not matching any previous entries. Sample error
    nginx: [warn] duplicate extension "woff", content type: "font/woff", previous content type: "font/woff" in /etc/nginx/mime.types:100
    nginx: [warn] duplicate extension "woff2", content type: "font/woff2", previous content type: "font/woff2" in /etc/nginx/mime.types:101

Doc Changes

  • Add deprecated messages to Alpine, CentOS
  • Move most of the docs to docs/
  • Add additional output in docs/ when testing HTTPS usage locally
  • Add quickstart
  • Add troubleshooting

CI Changes

  • Updated ci and publish jobs to build the new image with -ubuntu-22.04 tag

Other Changes

  • Add Makefile for common local dev operations

Additional data

Nginx Package Versions

As of Jul 15, 2022, these are the versions that it builds with:

ii  nginx                       1.22.0-1~jammy                          amd64        high performance web server
ii  nginx-module-njs            1.22.0+0.7.5-1~jammy                    amd64        nginx njs dynamic modules

Steps to build locally

  1. Clone fork
cd /tmp
git clone git@github.com:adobejmong/docker-nginx.git
cd docker-nginx
git checkout ETHOS-36876
  1. Build it locally
# Builds an AMD64 image
make

# To build an ARM64 image
VERSION=arm64 PLATFORM=linux/arm64 make

Steps to test locally

To test the njs module, I worked with @kmashint to create a simple test. The test assumes that you have dgoss installed.

cd tests/njs
make dgoss

Sample output:

GOSS_WAIT_OPTS="-r 60s -s 5s > /dev/null" dgoss run -e SERVER_ENABLE_NGX_HTTP_JS=true -p 8080:8080 docker-nginx:njs-test
INFO: Starting docker container
INFO: Container ID: e2e48808
INFO: Found goss_wait.yaml, waiting for it to pass before running tests
INFO: Sleeping for 0.2
INFO: Container health
INFO: Running Tests
HTTP: http://localhost:8080/hello_njs: status: matches expectation: [200]
HTTP: http://localhost:8080/hello_njs: Body: matches expectation: [Hello there!]


Total Duration: 0.013s
Count: 2, Failed: 0, Skipped: 0
INFO: Deleting container

Image Size comparison

Use docker images or docker inspect for the linux/amd64 architecture:

Image Size (in MB)
Original (docker-nginx:10.0.0) 115
Without NJS 102
With NJS 103

@adobejmong adobejmong changed the title feat(ETHOS-36876): BREAKING - Switch to Ubuntu 22.04, Replace nginx, Add njs module (ubuntu only) feat(ETHOS-36876): BREAKING - Switch to Ubuntu 22.04, Replace nginx installation, Add njs module (ubuntu only) Jul 15, 2022
@adobejmong adobejmong self-assigned this Jul 15, 2022
@adobejmong adobejmong force-pushed the ETHOS-36876 branch 2 times, most recently from 2630700 to 172fd60 Compare July 15, 2022 03:41
@adobejmong adobejmong changed the title feat(ETHOS-36876): BREAKING - Switch to Ubuntu 22.04, Replace nginx installation, Add njs module (ubuntu only) feat(ETHOS-36876): Add new Ubuntu 22.04, Replace nginx installation, Add njs module (ubuntu only) Jul 15, 2022
@adobejmong adobejmong marked this pull request as draft July 15, 2022 14:00
@adobejmong adobejmong added major MAJOR changes ubuntu Ubuntu-specific change enhancement labels Jul 15, 2022
@adobejmong adobejmong marked this pull request as ready for review August 5, 2022 22:33
@adobejmong adobejmong merged commit 6b83872 into behance:master Aug 5, 2022
@adobejmong adobejmong deleted the ETHOS-36876 branch August 5, 2022 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement major MAJOR changes ubuntu Ubuntu-specific change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant