Skip to content

Commit

Permalink
Merge pull request #376 from ajhodgson/ajhodgson/upgrade-to-jammy
Browse files Browse the repository at this point in the history
Upgrade to Ubuntu 22.04 baseimage
  • Loading branch information
CamJN committed Oct 25, 2023
2 parents de5b806 + bf1daba commit 8dd0b29
Show file tree
Hide file tree
Showing 29 changed files with 920 additions and 372 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,6 @@ jobs:
if: ${{ github.event.pull_request.merged && github.ref == 'refs/heads/master' }}
run: make release_customizable

build-ruby27:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Purge containers
run: 'docker kill $(docker ps -q) || exit 0'

- name: Enable docker multiarch
run: 'docker run --privileged --rm tonistiigi/binfmt --install all'

- name: Run make build_ruby27
run: make build_ruby27

- name: Log in to the Container registry
if: ${{ github.event.pull_request.merged && github.ref == 'refs/heads/master' }}
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push to github container registry
if: ${{ github.event.pull_request.merged && github.ref == 'refs/heads/master' }}
run: make release_ruby27

build-ruby30:
runs-on: ubuntu-latest
steps:
Expand Down
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
## not released
* Switched image base to phusion/baseimage:jammy-1.0.1
* Upgraded to Ubuntu 22.04 LTS (Jammy)
* Default Python version is now 3.10, and Python 2.7 is no longer installed by default
* Updated Python install script to be able to install any supported version from base or the Deadsnakes PPA
* Updated Node.js install script to be able to install any supported version from Nodesource; default version is still 18
* Created yarn and related executables whenever installing Node.js
* Removed Ruby 2.7 (EOL 2023-03-31)
* Compile all CRuby versions from source to ensure uniformity and YJIT capability in versions 3.1+
* Use Ruby 3.2.x by default
* Upgraded to JRuby 9.3.10.0
* Upgraded to JRuby 9.4.3.0
* Upgraded to JRuby 9.3.11.0 (from 9.3.9.0)
* Upgraded to JRuby 9.4.3.0 (from 9.4.0.0)

## 2.5.1 (release date: 2023-06-14)
* Upgraded to Phusion Passenger 6.0.18 (from 6.0.17).
Expand Down
46 changes: 4 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ VERSION = 2.5.1
# Example: `export EXTRA_BUILD_FLAGS=--no-cache; make build_all`
EXTRA_BUILD_FLAGS?=

.PHONY: all build_all release clean clean_images labels tag_latest push build_customizable build_ruby27 build_ruby30 build_ruby31 build_ruby32 build_jruby93 build_jruby94 build_nodejs build_full
.PHONY: all build_all release clean clean_images labels tag_latest push build_customizable build_ruby30 build_ruby31 build_ruby32 build_jruby93 build_jruby94 build_nodejs build_full

all: build_all

Expand All @@ -22,7 +22,6 @@ build_all: \
build_jruby93 \
build_jruby94 \
build_nodejs \
build_ruby27 \
build_ruby30 \
build_ruby31 \
build_ruby32 \
Expand All @@ -32,8 +31,6 @@ build_all: \
labels:
@echo $(NAME)-customizable:$(VERSION)-amd64 $(NAME)-customizable:latest-amd64
@echo $(NAME)-customizable:$(VERSION)-arm64 $(NAME)-customizable:latest-arm64
@echo $(NAME)-ruby27:$(VERSION)-amd64 $(NAME)-ruby27:latest-amd64
@echo $(NAME)-ruby27:$(VERSION)-arm64 $(NAME)-ruby27:latest-arm64
@echo $(NAME)-ruby30:$(VERSION)-amd64 $(NAME)-ruby30:latest-amd64
@echo $(NAME)-ruby30:$(VERSION)-arm64 $(NAME)-ruby30:latest-arm64
@echo $(NAME)-ruby31:$(VERSION)-amd64 $(NAME)-ruby31:latest-amd64
Expand All @@ -52,8 +49,6 @@ labels:
pull:
docker pull $(NAME)-customizable:$(VERSION)-amd64
docker pull $(NAME)-customizable:$(VERSION)-arm64
docker pull $(NAME)-ruby27:$(VERSION)-amd64
docker pull $(NAME)-ruby27:$(VERSION)-arm64
docker pull $(NAME)-ruby30:$(VERSION)-amd64
docker pull $(NAME)-ruby30:$(VERSION)-arm64
docker pull $(NAME)-ruby31:$(VERSION)-amd64
Expand Down Expand Up @@ -87,14 +82,6 @@ build_customizable: build_base
docker buildx build --progress=plain --platform linux/amd64 $(EXTRA_BUILD_FLAGS) --build-arg REGISTRY=$(REGISTRY) --build-arg ARCH=amd64 -t $(NAME)-customizable:$(VERSION)-amd64 --rm customizable_image
docker buildx build --progress=plain --platform linux/arm64 $(EXTRA_BUILD_FLAGS) --build-arg REGISTRY=$(REGISTRY) --build-arg ARCH=arm64 -t $(NAME)-customizable:$(VERSION)-arm64 --rm customizable_image

build_ruby27: build_base
rm -rf ruby27_image
cp -pR image ruby27_image
echo ruby27=1 >> ruby27_image/buildconfig
echo final=1 >> ruby27_image/buildconfig
docker buildx build --progress=plain --platform linux/amd64 $(EXTRA_BUILD_FLAGS) --build-arg REGISTRY=$(REGISTRY) --build-arg ARCH=amd64 -t $(NAME)-ruby27:$(VERSION)-amd64 --rm ruby27_image
docker buildx build --progress=plain --platform linux/arm64 $(EXTRA_BUILD_FLAGS) --build-arg REGISTRY=$(REGISTRY) --build-arg ARCH=arm64 -t $(NAME)-ruby27:$(VERSION)-arm64 --rm ruby27_image

build_ruby30: build_base
rm -rf ruby30_image
cp -pR image ruby30_image
Expand Down Expand Up @@ -146,7 +133,6 @@ build_nodejs: build_base
build_full: build_base
rm -rf full_image
cp -pR image full_image
echo ruby27=1 >> full_image/buildconfig
echo ruby30=1 >> full_image/buildconfig
echo ruby31=1 >> full_image/buildconfig
echo ruby32=1 >> full_image/buildconfig
Expand All @@ -160,13 +146,11 @@ build_full: build_base
docker buildx build --progress=plain --platform linux/amd64 $(EXTRA_BUILD_FLAGS) --build-arg REGISTRY=$(REGISTRY) --build-arg ARCH=amd64 -t $(NAME)-full:$(VERSION)-amd64 --rm full_image
docker buildx build --progress=plain --platform linux/arm64 $(EXTRA_BUILD_FLAGS) --build-arg REGISTRY=$(REGISTRY) --build-arg ARCH=arm64 -t $(NAME)-full:$(VERSION)-arm64 --rm full_image

tag_latest: tag_latest_customizable tag_latest_ruby27 tag_latest_ruby30 tag_latest_ruby31 tag_latest_ruby32 tag_latest_jruby93 tag_latest_jruby94 tag_latest_nodejs tag_latest_full
tag_latest: tag_latest_customizable tag_latest_ruby30 tag_latest_ruby31 tag_latest_ruby32 tag_latest_jruby93 tag_latest_jruby94 tag_latest_nodejs tag_latest_full

cross_tag:
docker tag ghcr.io/phusion/passenger-customizable:$(VERSION)-amd64 $(NAME)-customizable:$(VERSION)-amd64
docker tag ghcr.io/phusion/passenger-customizable:$(VERSION)-arm64 $(NAME)-customizable:$(VERSION)-arm64
docker tag ghcr.io/phusion/passenger-ruby27:$(VERSION)-amd64 $(NAME)-ruby27:$(VERSION)-amd64
docker tag ghcr.io/phusion/passenger-ruby27:$(VERSION)-arm64 $(NAME)-ruby27:$(VERSION)-arm64
docker tag ghcr.io/phusion/passenger-ruby30:$(VERSION)-amd64 $(NAME)-ruby30:$(VERSION)-amd64
docker tag ghcr.io/phusion/passenger-ruby30:$(VERSION)-arm64 $(NAME)-ruby30:$(VERSION)-arm64
docker tag ghcr.io/phusion/passenger-ruby31:$(VERSION)-amd64 $(NAME)-ruby31:$(VERSION)-amd64
Expand All @@ -186,10 +170,6 @@ tag_latest_customizable:
docker tag $(NAME)-customizable:$(VERSION)-amd64 $(NAME)-customizable:latest-amd64
docker tag $(NAME)-customizable:$(VERSION)-arm64 $(NAME)-customizable:latest-arm64

tag_latest_ruby27:
docker tag $(NAME)-ruby27:$(VERSION)-amd64 $(NAME)-ruby27:latest-amd64
docker tag $(NAME)-ruby27:$(VERSION)-arm64 $(NAME)-ruby27:latest-arm64

tag_latest_ruby30:
docker tag $(NAME)-ruby30:$(VERSION)-amd64 $(NAME)-ruby30:latest-amd64
docker tag $(NAME)-ruby30:$(VERSION)-arm64 $(NAME)-ruby30:latest-arm64
Expand Down Expand Up @@ -218,20 +198,14 @@ tag_latest_full:
docker tag $(NAME)-full:$(VERSION)-amd64 $(NAME)-full:latest-amd64
docker tag $(NAME)-full:$(VERSION)-arm64 $(NAME)-full:latest-arm64

push: push_customizable push_ruby27 push_ruby30 push_ruby31 push_ruby32 push_jruby93 push_jruby94 push_nodejs push_full
push: push_customizable push_ruby30 push_ruby31 push_ruby32 push_jruby93 push_jruby94 push_nodejs push_full

push_customizable: tag_latest_customizable
docker push $(NAME)-customizable:latest-amd64
docker push $(NAME)-customizable:latest-arm64
docker push $(NAME)-customizable:$(VERSION)-amd64
docker push $(NAME)-customizable:$(VERSION)-arm64

push_ruby27: tag_latest_ruby27
docker push $(NAME)-ruby27:latest-amd64
docker push $(NAME)-ruby27:latest-arm64
docker push $(NAME)-ruby27:$(VERSION)-amd64
docker push $(NAME)-ruby27:$(VERSION)-arm64

push_ruby30: tag_latest_ruby30
docker push $(NAME)-ruby30:latest-amd64
docker push $(NAME)-ruby30:latest-arm64
Expand Down Expand Up @@ -274,7 +248,7 @@ push_full: tag_latest_full
docker push $(NAME)-full:$(VERSION)-amd64
docker push $(NAME)-full:$(VERSION)-arm64

release: release_full release_customizable release_jruby93 release_jruby94 release_nodejs release_ruby32 release_ruby31 release_ruby30 release_ruby27
release: release_full release_customizable release_jruby93 release_jruby94 release_nodejs release_ruby32 release_ruby31 release_ruby30
test -z "$$(git status --porcelain)" && git commit -am "$(VERSION)" && git tag "rel-$(VERSION)" && git push origin "rel-$(VERSION)"

release_full: push_full
Expand Down Expand Up @@ -333,17 +307,9 @@ release_ruby30: push_ruby30
docker manifest push $(NAME)-ruby30:$(VERSION)
docker manifest push $(NAME)-ruby30:latest

release_ruby27: push_ruby27
docker manifest rm $(NAME)-ruby27:latest || true
docker manifest create $(NAME)-ruby27:$(VERSION) $(NAME)-ruby27:$(VERSION)-amd64 $(NAME)-ruby27:$(VERSION)-arm64
docker manifest create $(NAME)-ruby27:latest $(NAME)-ruby27:latest-amd64 $(NAME)-ruby27:latest-arm64
docker manifest push $(NAME)-ruby27:$(VERSION)
docker manifest push $(NAME)-ruby27:latest

clean:
rm -rf base_image
rm -rf customizable_image
rm -rf ruby27_image
rm -rf ruby30_image
rm -rf ruby31_image
rm -rf ruby32_image
Expand All @@ -355,10 +321,6 @@ clean:
clean_images:
docker rmi $(NAME)-customizable:latest-amd64 $(NAME)-customizable:$(VERSION)-amd64 || true
docker rmi $(NAME)-customizable:latest-arm64 $(NAME)-customizable:$(VERSION)-arm64 || true
docker rmi $(NAME)-ruby26:latest-amd64 $(NAME)-ruby26:$(VERSION)-amd64 || true
docker rmi $(NAME)-ruby26:latest-arm64 $(NAME)-ruby26:$(VERSION)-arm64 || true
docker rmi $(NAME)-ruby27:latest-amd64 $(NAME)-ruby27:$(VERSION)-amd64 || true
docker rmi $(NAME)-ruby27:latest-arm64 $(NAME)-ruby27:$(VERSION)-arm64 || true
docker rmi $(NAME)-ruby30:latest-amd64 $(NAME)-ruby30:$(VERSION)-amd64 || true
docker rmi $(NAME)-ruby30:latest-arm64 $(NAME)-ruby30:$(VERSION)-arm64 || true
docker rmi $(NAME)-ruby31:latest-amd64 $(NAME)-ruby31:$(VERSION)-amd64 || true
Expand Down
54 changes: 24 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Why is this image called "passenger"? It's to represent the ease: you just have
[Github](https://github.com/phusion/passenger-docker) |
[Docker registry](https://registry.hub.docker.com/r/phusion/passenger-full/) |
[Discussion forum](https://groups.google.com/d/forum/passenger-docker) |
[Twitter](https://twitter.com/phusion_nl) |
[Twitter/X](https://twitter.com/phusion_nl) |
[Blog](http://blog.phusion.nl/)

---------------------------------------
Expand Down Expand Up @@ -85,7 +85,7 @@ Why use passenger-docker instead of doing everything yourself in Dockerfile?

Basics (learn more at [baseimage-docker](http://phusion.github.io/baseimage-docker/)):

* Ubuntu 20.04 LTS as base system.
* Ubuntu 22.04 LTS as base system.
* A **correct** init process ([learn more](http://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/)).
* Fixes APT incompatibilities with Docker.
* syslog-ng.
Expand All @@ -94,13 +94,13 @@ Basics (learn more at [baseimage-docker](http://phusion.github.io/baseimage-dock

Language support:

* Ruby 2.7.8, 3.0.6, 3.1.4, 3.2.2 and JRuby 9.3.10.0 and 9.4.3.0.
* Ruby 3.0.6, 3.1.4, 3.2.2 and JRuby 9.3.11.0 and 9.4.3.0.
* RVM is used to manage Ruby versions. [Why RVM?](#why_rvm)
* 3.2.2 is configured as the default.
* JRuby is installed from source, but we register an APT entry for it.
* JRuby uses OpenJDK 17.
* Python 2.7 and Python 3.8.
* Node.js 18.
* Python 2.7 or 3.10, or any version provided by the Deadsnakes PPA (currently 3.7, 3.8, 3.9, 3.11, and 3.12; see https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa).
* Node.js 18 by default, or any version provided by Nodesource (currently 16, 18, 20, 21; see https://github.com/nodesource/distributions).
* A build system, git, and development headers for many popular libraries, so that the most popular Ruby, Python and Node.js native extensions can be compiled without problems.

Web server and application server:
Expand All @@ -114,7 +114,7 @@ Web server and application server:

Auxiliary services and tools:

* Redis 5.0. Not installed by default.
* Redis 6.0. Not installed by default.
* Memcached. Not installed by default.

<a name="memory_efficiency"></a>
Expand All @@ -129,7 +129,6 @@ Passenger-docker consists of several images, each one tailor made for a specific

**Ruby images**

* `phusion/passenger-ruby27` - Ruby 2.7.
* `phusion/passenger-ruby30` - Ruby 3.0.
* `phusion/passenger-ruby31` - Ruby 3.1.
* `phusion/passenger-ruby32` - Ruby 3.2.
Expand All @@ -143,7 +142,7 @@ Passenger-docker consists of several images, each one tailor made for a specific
**Other images**

* `phusion/passenger-full` - Contains everything in the above images. Ruby, Python, Node.js, all in a single image for your convenience.
* `phusion/passenger-customizable` - Contains only the base system, as described in ["What's included?"](#whats_included). Specific Ruby, Python, and Node.js versions are not preinstalled beyond what is needed for the image to run, or which are inherited from the baseimage. This image is meant to be further customized through your Dockerfile. For example, using this image you can create a custom image that contains Ruby 2.7, Ruby 3.1 and Node.js.
* `phusion/passenger-customizable` - Contains only the base system, as described in ["What's included?"](#whats_included). Specific Ruby, Python, and Node.js versions are not preinstalled beyond what is needed for the image to run, or which are inherited from the baseimage. This image is meant to be further customized through your Dockerfile. For example, using this image you can create a custom image that contains Ruby 3.2 and Node.js.

In the rest of this document we're going to assume that the reader will be using `phusion/passenger-full`, unless otherwise stated. Simply substitute the name if you wish to use another image.

Expand All @@ -162,7 +161,7 @@ You don't have to download anything manually. The above command will automatical
<a name="getting_started"></a>
### Getting started

There are several images, e.g. `phusion/passenger-ruby27` and `phusion/passenger-nodejs`. Choose the one you want. See [Image variants](#image_variants).
There are several images, e.g. `phusion/passenger-ruby32` and `phusion/passenger-nodejs`. Choose the one you want. See [Image variants](#image_variants).

So put the following in your Dockerfile:

Expand All @@ -173,7 +172,6 @@ So put the following in your Dockerfile:
# a list of version numbers.
FROM phusion/passenger-full:<VERSION>
# Or, instead of the 'full' variant, use one of these:
#FROM phusion/passenger-ruby27:<VERSION>
#FROM phusion/passenger-ruby30:<VERSION>
#FROM phusion/passenger-ruby31:<VERSION>
#FROM phusion/passenger-ruby32:<VERSION>
Expand All @@ -197,18 +195,18 @@ CMD ["/sbin/my_init"]
#
# Uncomment the features you want:
#
# Node.js and Meteor standalone support (not needed if you will also be installing Ruby, unless you need a version other than the default)
#RUN /pd_build/nodejs.sh 18
#
# Ruby support
#RUN /pd_build/ruby-2.7.*.sh
#RUN /pd_build/ruby-3.0.*.sh
#RUN /pd_build/ruby-3.1.*.sh
#RUN /pd_build/ruby-3.2.*.sh
#RUN /pd_build/jruby-9.3.*.sh
#RUN /pd_build/jruby-9.4.*.sh
# Python support.
#RUN /pd_build/python.sh
# Node.js and Meteor standalone support.
# (not needed if you already have the above Ruby support)
#RUN /pd_build/nodejs.sh
#
# Python support
#RUN /pd_build/python.sh 3.10

# ...put your own build instructions here...

Expand Down Expand Up @@ -266,8 +264,14 @@ server {
passenger_ruby /usr/bin/ruby3.1;
# For Ruby 3.0
passenger_ruby /usr/bin/ruby3.0;
# For Ruby 2.7
passenger_ruby /usr/bin/ruby2.7;
# For Python ie. Django
passenger_app_type wsgi;
passenger_startup_file passenger_wsgi.py; (contents example: https://gist.github.com/ajhodgson/96c51dba349697e5c7e46027cc530434)
# For Node.js
passenger_app_type node;
passenger_startup_file app.js;
# Nginx has a default limit of 1 MB for request bodies, which also applies
# to file uploads. The following line enables uploads of up to 50 MB:
Expand Down Expand Up @@ -430,16 +434,14 @@ We use [RVM](https://rvm.io/) to install and to manage Ruby interpreters. Becaus
The default Ruby (what the `/usr/bin/ruby` command executes) is the latest Ruby version that you've chosen to install. You can use RVM select a different version as default.

```dockerfile
# Ruby 2.7.8
RUN bash -lc 'rvm --default use ruby-2.7.8'
# Ruby 3.0.6
RUN bash -lc 'rvm --default use ruby-3.0.6'
# Ruby 3.1.4
RUN bash -lc 'rvm --default use ruby-3.1.4'
# Ruby 3.2.2
RUN bash -lc 'rvm --default use ruby-3.2.2'
# JRuby 9.3.10.0
RUN bash -lc 'rvm --default use jruby-9.3.10.0'
# JRuby 9.3.11.0
RUN bash -lc 'rvm --default use jruby-9.3.11.0'
# JRuby 9.4.3.0
RUN bash -lc 'rvm --default use jruby-9.4.3.0'
```
Expand All @@ -452,10 +454,6 @@ Learn more: [RVM: Setting the default Ruby](https://rvm.io/rubies/default).
You can run any command with a specific Ruby version by prefixing it with `rvm-exec <IDENTIFIER>`. For example:

```bash
$ rvm-exec 2.7.8 ruby -v
Using /usr/local/rvm/gems/ruby-2.7.8
ruby 2.7.8p225 (2023-03-30 revision 1f4d455848) [x86_64-linux]

$ rvm-exec 3.1.4 ruby -v
Using /usr/local/rvm/gems/ruby-3.1.4
ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
Expand All @@ -464,9 +462,6 @@ ruby 3.1.4p223 (2023-03-30 revision 957bb7cb81) [x86_64-linux]
More examples, but with Bundler instead:

```bash
# This runs 'bundle install' using Ruby 2.7.8
rvm-exec 2.7.8 bundle install

# This runs 'bundle install' using Ruby 3.1.4
rvm-exec 3.1.4 bundle install
```
Expand Down Expand Up @@ -828,7 +823,6 @@ Start a virtual machine with Docker in it. You can use the Vagrantfile that we'v

Build one of the images:

make build_ruby27
make build_ruby30
make build_ruby31
make build_ruby32
Expand Down
2 changes: 1 addition & 1 deletion image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ MAINTAINER Phusion <info@phusion.nl>
ADD . /pd_build

ARG ARCH
RUN --mount=type=cache,target=/rvm_cache \
RUN --mount=type=cache,target=/build_cache \
/usr/bin/nice /pd_build/install_image.sh

CMD ["/sbin/my_init"]
Expand Down
6 changes: 3 additions & 3 deletions image/Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# syntax=docker/dockerfile:1.2
FROM phusion/baseimage:master
FROM phusion/baseimage:jammy-1.0.1
MAINTAINER Phusion <info@phusion.nl>

ADD . /pd_build

ARG ARCH
RUN --mount=type=cache,target=/rvm_cache \
rm -rf "/rvm_cache/${ARCH}" && \
RUN --mount=type=cache,target=/build_cache \
rm -rf "/build_cache/${ARCH}" && \
/usr/bin/nice /pd_build/install_base.sh && \
rm -rf /pd_build
Loading

0 comments on commit 8dd0b29

Please sign in to comment.