Skip to content

Commit 0f491d2

Browse files
committed
Add bookworm-buildpack flavor (#267)
Signed-off-by: Evan Wies <evan@neomantra.net>
1 parent 8f8bf79 commit 0f491d2

File tree

4 files changed

+86
-5
lines changed

4 files changed

+86
-5
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ jobs:
148148
- ./docker_build_and_push_flavor.sh centos7-aarch64 centos7/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64
149149
- ./docker_build_and_push_flavor.sh fedora-aarch64 fedora/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64
150150
- ./docker_build_and_push_flavor.sh bookworm-aarch64 bookworm/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64"
151+
- ./docker_build_and_push_flavor.sh bookworm-buildpack-aarch64 bookworm/Dockerfile.buildpack --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64"
151152
- ./docker_build_and_push_flavor.sh bullseye-aarch64 bullseye/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian"
152153
- ./docker_build_and_push_flavor.sh bullseye-debug-aarch64 bullseye/Dockerfile.debug --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian"
153154
- ./docker_build_and_push_flavor.sh bullseye-valgrind-aarch64 bullseye/Dockerfile.valgrind --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian"
@@ -164,6 +165,7 @@ jobs:
164165
- ./docker_build_and_push_flavor.sh centos7-amd64 centos7/Dockerfile
165166
- ./docker_build_and_push_flavor.sh fedora-amd64 fedora/Dockerfile
166167
- ./docker_build_and_push_flavor.sh bookworm-amd64 bookworm/Dockerfile
168+
- ./docker_build_and_push_flavor.sh bookworm-buildpack-amd64 bookworm/Dockerfile.buildpack
167169
- ./docker_build_and_push_flavor.sh bullseye-amd64 bullseye/Dockerfile
168170
- ./docker_build_and_push_flavor.sh bullseye-debug-amd64 bullseye/Dockerfile.debug
169171
- ./docker_build_and_push_flavor.sh bullseye-valgrind-amd64 bullseye/Dockerfile.valgrind
@@ -182,6 +184,7 @@ jobs:
182184
- ./docker_manifest.sh amzn2 amzn2-amd64 amzn2-aarch64
183185
- ./docker_manifest.sh bionic  bionic-amd64 bionic-aarch64 bionic-s390x
184186
- ./docker_manifest.sh bookworm bookworm-amd64 bookworm-aarch64
187+
- ./docker_manifest.sh bookworm-buildpack bookworm-buildpack-amd64 bookworm-buildpack-aarch64
185188
- ./docker_manifest.sh bullseye bullseye-amd64 bullseye-aarch64
186189
- ./docker_manifest.sh bullseye-debug bullseye-debug-amd64 bullseye-debug-aarch64
187190
- ./docker_manifest.sh bullseye-valgrind bullseye-valgrind-amd64 bullseye-valgrind-aarch64

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Changelog
22
=========
33

4-
## 1.27.1.1-3 (2025-02-25)
4+
## 1.27.1.1-4 (unreleased)
55

6-
* Update `alpine-apk` flavor to Alpine 3.18.12
6+
* Add `bookworm-buildpack` flavor. ([#267](https://github.com/openresty/docker-openresty/issues/267))
77

88
## 1.25.3.2-3 (2025-02-25)
99

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ The following "flavors" are available and built from [upstream OpenResty package
8585

8686
- [`alpine-apk`, (*alpine-apk/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/alpine-apk/Dockerfile)
8787
- [`amzn2`, (*centos/Dockerfile* with `amzn2`)](https://github.com/openresty/docker-openresty/blob/master/centos/Dockerfile)
88-
- [`bookworm-fat`, (*bookworm-fat/Dockerfile.fat*)](https://github.com/openresty/docker-openresty/blob/master/bookworm-fat/Dockerfile.fat)
88+
- [`bookworm-buildpack`, (*bookworm/Dockerfile.buildpack*)](https://github.com/openresty/docker-openresty/blob/master/bookworm/Dockerfile.buildpack)
89+
- [`bookworm-fat`, (*bookworm/Dockerfile.fat*)](https://github.com/openresty/docker-openresty/blob/master/bookworm/Dockerfile.fat)
8990
- [`bookworm`, (*bookworm/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/bookworm/Dockerfile)
9091
- [`bullseye-fat`, (*bullseye/Dockerfile.fat*)](https://github.com/openresty/docker-openresty/blob/master/bullseye/Dockerfile.fat)
9192
- [`bullseye`, (*bullseye/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/bullseye/Dockerfile)
@@ -118,8 +119,6 @@ OpenResty supports SSE 4.2 optimizations. Starting with the `1.19.3.1` series,
118119

119120
It is *highly recommended* that you use the upstream-based images for best support. For best stability, pin your images to the full tag, for example `1.21.4.1-0-bionic`.
120121

121-
At this time, the only images that are compatible with aarch64 are `alpine` and `alpine-fat`. Once there are binary packages available, they can be released with the upstream packages.
122-
123122
Policies
124123
========
125124

bookworm/Dockerfile.buildpack

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# Dockerfile - buildpack-deps
2+
# https://github.com/openresty/docker-openresty
3+
4+
ARG RESTY_IMAGE_BASE="buildpack-deps"
5+
ARG RESTY_IMAGE_TAG="bookworm"
6+
7+
FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG}
8+
9+
LABEL maintainer="Evan Wies <evan@neomantra.net>"
10+
11+
# RESTY_DEB_FLAVOR build argument is used to select other
12+
# OpenResty Debian package variants.
13+
# For example: "-debug" or "-valgrind"
14+
ARG RESTY_DEB_FLAVOR=""
15+
ARG RESTY_DEB_VERSION="=1.27.1.1-1~bookworm1"
16+
ARG RESTY_APT_REPO="https://openresty.org/package/debian"
17+
ARG RESTY_APT_PGP="https://openresty.org/package/pubkey.gpg"
18+
ARG RESTY_APT_ARCH="amd64"
19+
ARG RESTY_IMAGE_BASE="buildpack-deps"
20+
ARG RESTY_IMAGE_TAG="bookworm"
21+
22+
ARG RESTY_LUAROCKS_VERSION="3.11.1"
23+
24+
LABEL resty_image_base="${RESTY_IMAGE_BASE}"
25+
LABEL resty_image_tag="${RESTY_IMAGE_TAG}"
26+
LABEL resty_apt_repo="${RESTY_APT_REPO}"
27+
LABEL resty_apt_pgp="${RESTY_APT_PGP}"
28+
LABEL resty_apt_arch="${RESTY_APT_ARCH}"
29+
LABEL resty_deb_flavor="${RESTY_DEB_FLAVOR}"
30+
LABEL resty_deb_version="${RESTY_DEB_VERSION}"
31+
LABEL resty_luarocks_version="${RESTY_LUAROCKS_VERSION}}"
32+
33+
# Install OpenResty
34+
RUN wget -qO - ${RESTY_APT_PGP} | gpg --dearmor > /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
35+
&& chown root:root /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
36+
&& chmod ugo+r /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
37+
&& chmod go-w /etc/apt/trusted.gpg.d/openresty-keyring.gpg \
38+
&& echo "deb [arch=$RESTY_APT_ARCH signed-by=/etc/apt/trusted.gpg.d/openresty-keyring.gpg] $RESTY_APT_REPO $(grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release) openresty" | tee /etc/apt/sources.list.d/openresty.list \
39+
&& DEBIAN_FRONTEND=noninteractive apt-get update \
40+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
41+
openresty${RESTY_DEB_FLAVOR}${RESTY_DEB_VERSION} \
42+
openresty-resty${RESTY_FAT_DEB_FLAVOR}${RESTY_FAT_DEB_VERSION} \
43+
openresty-opm${RESTY_FAT_DEB_FLAVOR}${RESTY_FAT_DEB_VERSION} \
44+
&& mkdir -p /var/run/openresty \
45+
&& ln -sf /dev/stdout /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/logs/access.log \
46+
&& ln -sf /dev/stderr /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/logs/error.log
47+
48+
# Install LuaRocks
49+
RUN curl -fSL https://luarocks.github.io/luarocks/releases/luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
50+
&& tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \
51+
&& cd luarocks-${RESTY_LUAROCKS_VERSION} \
52+
&& ./configure \
53+
--prefix=/usr/local/openresty/luajit \
54+
--with-lua=/usr/local/openresty/luajit \
55+
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
56+
&& make build \
57+
&& make install \
58+
&& cd /tmp \
59+
&& rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz
60+
61+
# Add additional binaries into PATH for convenience
62+
ENV PATH="$PATH:/usr/local/openresty${RESTY_DEB_FLAVOR}/luajit/bin:/usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/sbin:/usr/local/openresty${RESTY_DEB_FLAVOR}/bin"
63+
64+
# Add LuaRocks paths
65+
# If OpenResty changes, these may need updating:
66+
# /usr/local/openresty/bin/resty -e 'print(package.path)'
67+
# /usr/local/openresty/bin/resty -e 'print(package.cpath)'
68+
ENV LUA_PATH="/usr/local/openresty/site/lualib/?.ljbc;/usr/local/openresty/site/lualib/?/init.ljbc;/usr/local/openresty/lualib/?.ljbc;/usr/local/openresty/lualib/?/init.ljbc;/usr/local/openresty/site/lualib/?.lua;/usr/local/openresty/site/lualib/?/init.lua;/usr/local/openresty/lualib/?.lua;/usr/local/openresty/lualib/?/init.lua;./?.lua;/usr/local/openresty/luajit/share/luajit-2.1/?.lua;/usr/local/share/lua/5.1/?.lua;/usr/local/share/lua/5.1/?/init.lua;/usr/local/openresty/luajit/share/lua/5.1/?.lua;/usr/local/openresty/luajit/share/lua/5.1/?/init.lua"
69+
ENV LUA_CPATH="/usr/local/openresty/site/lualib/?.so;/usr/local/openresty/lualib/?.so;./?.so;/usr/local/lib/lua/5.1/?.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so;/usr/local/lib/lua/5.1/loadall.so;/usr/local/openresty/luajit/lib/lua/5.1/?.so"
70+
71+
# Copy nginx configuration files
72+
COPY nginx.conf /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/conf/nginx.conf
73+
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
74+
75+
CMD ["/usr/bin/openresty", "-g", "daemon off;"]
76+
77+
# Use SIGQUIT instead of default SIGTERM to cleanly drain requests
78+
# See https://github.com/openresty/docker-openresty/blob/master/README.md#tips--pitfalls
79+
STOPSIGNAL SIGQUIT

0 commit comments

Comments
 (0)