diff --git a/.travis.yml b/.travis.yml index a3c9f8e..a21199a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -160,6 +160,8 @@ jobs: - ./docker_build_and_push_flavor.sh centos-aarch64 centos/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64 - ./docker_build_and_push_flavor.sh centos7-aarch64 centos7/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64 - ./docker_build_and_push_flavor.sh fedora-aarch64 fedora/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64 + - ./docker_build_and_push_flavor.sh trixie-aarch64 trixie/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64" + - ./docker_build_and_push_flavor.sh trixie-buildpack-aarch64 trixie/Dockerfile.buildpack --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64" - ./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" - ./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" - ./docker_build_and_push_flavor.sh bullseye-aarch64 bullseye/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" @@ -176,6 +178,8 @@ jobs: - ./docker_build_and_push_flavor.sh centos-amd64 centos/Dockerfile - ./docker_build_and_push_flavor.sh centos7-amd64 centos7/Dockerfile - ./docker_build_and_push_flavor.sh fedora-amd64 fedora/Dockerfile + - ./docker_build_and_push_flavor.sh trixie-amd64 trixie/Dockerfile + - ./docker_build_and_push_flavor.sh trixie-buildpack-amd64 trixie/Dockerfile.buildpack - ./docker_build_and_push_flavor.sh bookworm-amd64 bookworm/Dockerfile - ./docker_build_and_push_flavor.sh bookworm-buildpack-amd64 bookworm/Dockerfile.buildpack - ./docker_build_and_push_flavor.sh bullseye-amd64 bullseye/Dockerfile @@ -186,7 +190,7 @@ jobs: # Multi-arch manifests ############################################################################### - # also master bookworm gets tagged "latest" + # also master trixie gets tagged "latest" - name: Create and push manifests for multi-arch images stage: manifest script: @@ -207,12 +211,14 @@ jobs: - ./docker_manifest.sh jammy jammy-amd64 jammy-aarch64 jammy-s390x - ./docker_manifest.sh noble noble-amd64 noble-aarch64 noble-s390x - ./docker_manifest.sh rocky rocky-amd64 rocky-aarch64 + - ./docker_manifest.sh trixie trixie-amd64 trixie-aarch64 + - ./docker_manifest.sh trixie-buildpack trixie-buildpack-amd64 trixie-buildpack-aarch64 - ./docker_tag_alias.sh centos centos-rpm - ./docker_tag_alias.sh fedora fedora-rpm - if [[ "$TRAVIS_BRANCH" == "master" ]] ; then echo "$DOCKER_PASSWORD" | docker login -u="$DOCKER_USERNAME" --password-stdin && - docker pull $DOCKER_ORG/openresty:bookworm && - docker tag $DOCKER_ORG/openresty:bookworm $DOCKER_ORG/openresty:latest && + docker pull $DOCKER_ORG/openresty:trixie && + docker tag $DOCKER_ORG/openresty:trixie $DOCKER_ORG/openresty:latest && docker push $DOCKER_ORG/openresty:latest ; fi @@ -225,6 +231,7 @@ jobs: stage: build-fat arch: arm64 script: + - ./docker_build_and_push_flavor_fat.sh trixie-fat-aarch64 trixie/Dockerfile.fat - ./docker_build_and_push_flavor_fat.sh bookworm-fat-aarch64 bookworm/Dockerfile.fat - ./docker_build_and_push_flavor_fat.sh bullseye-fat-aarch64 bullseye/Dockerfile.fat - ./docker_build_and_push_flavor_fat.sh alpine-fat-aarch64 alpine/Dockerfile.fat @@ -233,6 +240,7 @@ jobs: arch: amd64 stage: build-fat script: + - ./docker_build_and_push_flavor_fat.sh trixie-fat-amd64 trixie/Dockerfile.fat - ./docker_build_and_push_flavor_fat.sh bookworm-fat-amd64 bookworm/Dockerfile.fat - ./docker_build_and_push_flavor_fat.sh bullseye-fat-amd64 bullseye/Dockerfile.fat - ./docker_build_and_push_flavor_fat.sh alpine-fat-amd64 alpine/Dockerfile.fat @@ -240,6 +248,7 @@ jobs: - name: Create and push manifests for fat multi-arch images stage: manifest-fat script: + - ./docker_manifest.sh trixie-fat trixie-fat-amd64 trixie-fat-aarch64 - ./docker_manifest.sh bookworm-fat bookworm-fat-amd64 bookworm-fat-aarch64 - ./docker_manifest.sh bullseye-fat bullseye-fat-amd64 bullseye-fat-aarch64 - ./docker_manifest.sh alpine-fat alpine-fat-amd64 alpine-fat-aarch64 diff --git a/BUILDING.md b/BUILDING.md index 46cede8..4e9c0b0 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -144,6 +144,7 @@ You can derive your own Docker images from this to install your own packages. S This Docker image can be built and customized by cloning the repo and running `docker build` with the desired Dockerfile: + * [Debian Trixie 13 DEB](https://github.com/openresty/docker-openresty/blob/master/trixie/Dockerfile) (`trixie/Dockerfile`) * [Debian Bookworm 12 DEB](https://github.com/openresty/docker-openresty/blob/master/bookworm/Dockerfile) (`bookworm/Dockerfile`) * [Debian Bullseye 11 DEB](https://github.com/openresty/docker-openresty/blob/master/bullseye/Dockerfile) (`bullseye/Dockerfile`) diff --git a/README.md b/README.md index dfad0a5..4bc023f 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,9 @@ The following "flavors" are available and built from [upstream OpenResty package - [`centos7`, (*centos7/Dockerfile* with `el7`)](https://github.com/openresty/docker-openresty/blob/master/centos7/Dockerfile) - [`fedora`, `fedora-rpm`, (*fedora/Dockerfile* with `fc36`)](https://github.com/openresty/docker-openresty/blob/master/fedora/Dockerfile) - [`rocky`, (*fedora/Dockerfile* with `rockylinux`)](https://github.com/openresty/docker-openresty/blob/master/fedora/Dockerfile) +- [`trixie-buildpack`, (*trixie/Dockerfile.buildpack*)](https://github.com/openresty/docker-openresty/blob/master/trixie/Dockerfile.buildpack) +- [`trixie-fat`, (*trixie/Dockerfile.fat*)](https://github.com/openresty/docker-openresty/blob/master/trixie/Dockerfile.fat) +- [`trixie`, (*trixie/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/trixie/Dockerfile) - [`windows`, (*windows/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/windows/Dockerfile) The following "flavors" are built from source and are intended for more advanced and custom usage, caveat emptor: @@ -115,7 +118,7 @@ The following "flavors" are built from source and are intended for more advanced - [`jammy`, (*jammy/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/jammy/Dockerfile) - [`noble`, (*noble/Dockerfile*)](https://github.com/openresty/docker-openresty/blob/master/noble/Dockerfile) -The `openresty/openresty:latest` tag points to the latest `bookworm` image. +The `openresty/openresty:latest` tag points to the latest `trixie` image. Since `1.19.3.2-1`, all flavors support multi-architecture builds, both `amd64` and `aarch64`. Since `1.21.4.1-1`, the `s390x` architecture is supported for build-from-source Ubuntu flavors (like `jammy`); prior to version `1.27.1.2-3`, [PCRE JIT](https://github.com/zherczeg/sljit/issues/89) is disabled for `s390x`. @@ -195,7 +198,7 @@ OPM Starting at version 1.11.2.2, OpenResty for Linux includes a [package manager called `opm`](https://github.com/openresty/opm#readme), which can be found at `/usr/local/openresty/bin/opm`. -`opm` is built in all the images except `alpine` and `bullseye` and `bookworm`. +`opm` is built in all the images except `alpine` and `bullseye` and `bookworm` and `trixie`. To use `opm` in the `alpine` image, you must also install the `curl` and `perl` packages; they are not included by default because they double the image size. You may install them like so: `apk add --no-cache curl perl`. diff --git a/Taskfile.yml b/Taskfile.yml index 74962da..58e3ca1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,4 +1,4 @@ -# https://taskfile.dev/installation +# https://taskfile.dev/installation version: '3' @@ -6,7 +6,7 @@ tasks: default: cmds: - task --list-all - + build-all-arm64: deps: - build-all-upstream-arm64 @@ -27,6 +27,7 @@ tasks: - docker build -t centos-aarch64 -f centos/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64 . - docker build -t centos7-aarch64 -f centos7/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64 . - docker build -t fedora-aarch64 -f fedora/Dockerfile --build-arg RESTY_RPM_ARCH=aarch64 . + - docker build -t trixie-aarch64 -f trixie/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64" . - docker build -t bookworm-aarch64 -f bookworm/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" --build-arg RESTY_APT_ARCH="arm64" . - docker build -t bullseye-aarch64 -f bullseye/Dockerfile --build-arg RESTY_APT_REPO="https://openresty.org/package/arm64/debian" . @@ -38,6 +39,7 @@ tasks: - docker build -t centos-amd64 -f centos/Dockerfile --build-arg RESTY_RPM_ARCH=x86_64 . - docker build -t centos7-amd64 -f centos7/Dockerfile --build-arg RESTY_RPM_ARCH=x86_64 . - docker build -t fedora-amd64 -f fedora/Dockerfile --build-arg RESTY_RPM_ARCH=x86_64 . + - docker build -t trixie-amd64 -f trixie/Dockerfile --build-arg RESTY_APT_ARCH=amd64 . - docker build -t bookworm-amd64 -f bookworm/Dockerfile --build-arg RESTY_APT_ARCH=amd64 . - docker build -t bullseye-amd64 -f bullseye/Dockerfile --build-arg RESTY_APT_ARCH=amd64 . diff --git a/trixie/Dockerfile b/trixie/Dockerfile new file mode 100644 index 0000000..a0e18e8 --- /dev/null +++ b/trixie/Dockerfile @@ -0,0 +1,65 @@ +# Dockerfile - Debian 13 Trixie - DEB version +# https://github.com/openresty/docker-openresty + +ARG RESTY_IMAGE_BASE="debian" +ARG RESTY_IMAGE_TAG="trixie-slim" + +FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} + +LABEL maintainer="Evan Wies " + +# RESTY_DEB_FLAVOR build argument is used to select other +# OpenResty Debian package variants. +# For example: "-debug" or "-valgrind" +ARG RESTY_DEB_FLAVOR="" +ARG RESTY_DEB_VERSION="=1.27.1.2-1~bookworm1" +ARG RESTY_APT_REPO="https://openresty.org/package/debian" +ARG RESTY_APT_PGP="https://openresty.org/package/pubkey.gpg" +ARG RESTY_APT_ARCH="amd64" +ARG RESTY_IMAGE_BASE="debian" +ARG RESTY_IMAGE_TAG="bookworm-slim" + +LABEL resty_image_base="${RESTY_IMAGE_BASE}" +LABEL resty_image_tag="${RESTY_IMAGE_TAG}" +LABEL resty_apt_repo="${RESTY_APT_REPO}" +LABEL resty_apt_pgp="${RESTY_APT_PGP}" +LABEL resty_apt_arch="${RESTY_APT_ARCH}" +LABEL resty_deb_flavor="${RESTY_DEB_FLAVOR}" +LABEL resty_deb_version="${RESTY_DEB_VERSION}" + + +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + ca-certificates \ + gettext-base \ + gnupg \ + wget \ + && wget -qO - ${RESTY_APT_PGP} | gpg --dearmor > /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && chown root:root /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && chmod ugo+r /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && chmod go-w /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && echo "\nTypes: deb\nURIs: $RESTY_APT_REPO\nSuites: $RESTY_IMAGE_TAG\nComponents: openresty\nEnabled: yes\nArchitectures: $RESTY_APT_ARCH\nSigned-By: /etc/apt/trusted.gpg.d/openresty-keyring.gpg" >> /etc/apt/sources.list.d/debian.sources \ + && DEBIAN_FRONTEND=noninteractive apt-get remove -y --purge \ + gnupg \ + wget \ + && DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + openresty${RESTY_DEB_FLAVOR}${RESTY_DEB_VERSION} \ + && DEBIAN_FRONTEND=noninteractive apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p /var/run/openresty \ + && ln -sf /dev/stdout /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/logs/access.log \ + && ln -sf /dev/stderr /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/logs/error.log + +# Add additional binaries into PATH for convenience +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" + +# Copy nginx configuration files +COPY nginx.conf /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/conf/nginx.conf +COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf + +CMD ["/usr/bin/openresty", "-g", "daemon off;"] + +# Use SIGQUIT instead of default SIGTERM to cleanly drain requests +# See https://github.com/openresty/docker-openresty/blob/master/README.md#tips--pitfalls +STOPSIGNAL SIGQUIT diff --git a/trixie/Dockerfile.buildpack b/trixie/Dockerfile.buildpack new file mode 100644 index 0000000..61a4562 --- /dev/null +++ b/trixie/Dockerfile.buildpack @@ -0,0 +1,82 @@ +# Dockerfile - buildpack-deps +# https://github.com/openresty/docker-openresty + +ARG RESTY_IMAGE_BASE="buildpack-deps" +ARG RESTY_IMAGE_TAG="trixie" + +FROM ${RESTY_IMAGE_BASE}:${RESTY_IMAGE_TAG} + +LABEL maintainer="Evan Wies " + +# RESTY_DEB_FLAVOR build argument is used to select other +# OpenResty Debian package variants. +# For example: "-debug" or "-valgrind" +ARG RESTY_DEB_FLAVOR="" +ARG RESTY_DEB_VERSION="=1.27.1.2-1~bookworm1" +ARG RESTY_APT_REPO="https://openresty.org/package/debian" +ARG RESTY_APT_PGP="https://openresty.org/package/pubkey.gpg" +ARG RESTY_APT_ARCH="amd64" +ARG RESTY_IMAGE_BASE="buildpack-deps" +ARG RESTY_IMAGE_TAG="bookworm" + +ARG RESTY_LUAROCKS_VERSION="3.12.2" + +LABEL resty_image_base="${RESTY_IMAGE_BASE}" +LABEL resty_image_tag="${RESTY_IMAGE_TAG}" +LABEL resty_apt_repo="${RESTY_APT_REPO}" +LABEL resty_apt_pgp="${RESTY_APT_PGP}" +LABEL resty_apt_arch="${RESTY_APT_ARCH}" +LABEL resty_deb_flavor="${RESTY_DEB_FLAVOR}" +LABEL resty_deb_version="${RESTY_DEB_VERSION}" +LABEL resty_luarocks_version="${RESTY_LUAROCKS_VERSION}}" + +# Install OpenResty +RUN wget -qO - ${RESTY_APT_PGP} | gpg --dearmor > /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && chown root:root /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && chmod ugo+r /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && chmod go-w /etc/apt/trusted.gpg.d/openresty-keyring.gpg \ + && echo "\nTypes: deb\nURIs: $RESTY_APT_REPO\nSuites: $RESTY_IMAGE_TAG\nComponents: openresty\nEnabled: yes\nArchitectures: $RESTY_APT_ARCH\nSigned-By: /etc/apt/trusted.gpg.d/openresty-keyring.gpg" >> /etc/apt/sources.list.d/debian.sources \ + && DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + openresty${RESTY_DEB_FLAVOR}${RESTY_DEB_VERSION} \ + openresty-resty${RESTY_DEB_FLAVOR}${RESTY_DEB_VERSION} \ + openresty-opm${RESTY_DEB_FLAVOR}${RESTY_DEB_VERSION} \ + openresty-openssl3${RESTY_DEB_FLAVOR}-dev \ + openresty-pcre2${RESTY_DEB_FLAVOR}-dev \ + openresty-zlib${RESTY_DEB_FLAVOR}-dev \ + && mkdir -p /var/run/openresty \ + && ln -sf /dev/stdout /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/logs/access.log \ + && ln -sf /dev/stderr /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/logs/error.log + +# Install LuaRocks +RUN curl -fSL https://luarocks.github.io/luarocks/releases/luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz -o luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ + && tar xzf luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz \ + && cd luarocks-${RESTY_LUAROCKS_VERSION} \ + && ./configure \ + --prefix=/usr/local/openresty/luajit \ + --with-lua=/usr/local/openresty/luajit \ + --with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \ + && make build \ + && make install \ + && cd /tmp \ + && rm -rf luarocks-${RESTY_LUAROCKS_VERSION} luarocks-${RESTY_LUAROCKS_VERSION}.tar.gz + +# Add additional binaries into PATH for convenience +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" + +# Add LuaRocks paths +# If OpenResty changes, these may need updating: +# /usr/local/openresty/bin/resty -e 'print(package.path)' +# /usr/local/openresty/bin/resty -e 'print(package.cpath)' +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" +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" + +# Copy nginx configuration files +COPY nginx.conf /usr/local/openresty${RESTY_DEB_FLAVOR}/nginx/conf/nginx.conf +COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf + +CMD ["/usr/bin/openresty", "-g", "daemon off;"] + +# Use SIGQUIT instead of default SIGTERM to cleanly drain requests +# See https://github.com/openresty/docker-openresty/blob/master/README.md#tips--pitfalls +STOPSIGNAL SIGQUIT diff --git a/trixie/Dockerfile.fat b/trixie/Dockerfile.fat new file mode 100644 index 0000000..80ec18e --- /dev/null +++ b/trixie/Dockerfile.fat @@ -0,0 +1,34 @@ +# Dockerfile - Debian 13 Trixie Fat - DEB version +# https://github.com/openresty/docker-openresty +# +# This builds upon the base OpenResty Trixie image, +# adding useful packages and utilities. +# +# Currently it just adds the openresty-opm package. +# + +ARG RESTY_FAT_IMAGE_BASE="openresty/openresty" +ARG RESTY_FAT_IMAGE_TAG="trixie" + +FROM ${RESTY_FAT_IMAGE_BASE}:${RESTY_FAT_IMAGE_TAG} + +ARG RESTY_FAT_IMAGE_BASE="openresty/openresty" +ARG RESTY_FAT_IMAGE_TAG="bookworm" + +# RESTY_FAT_DEB_FLAVOR build argument is used to select other +# OpenResty Debian package variants. +# For example: "-debug" or "-valgrind" +ARG RESTY_FAT_DEB_FLAVOR="" +ARG RESTY_FAT_DEB_VERSION="=1.27.1.2-1~bookworm1" + +LABEL maintainer="Evan Wies " +LABEL resty_fat_deb_flavor="${RESTY_FAT_DEB_FLAVOR}" +LABEL resty_fat_deb_version="${RESTY_FAT_DEB_VERSION}" +LABEL resty_fat_image_base="${RESTY_FAT_IMAGE_BASE}" +LABEL resty_fat_image_tag="${RESTY_FAT_IMAGE_TAG}" + +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + openresty-resty${RESTY_FAT_DEB_FLAVOR}${RESTY_FAT_DEB_VERSION} \ + openresty-opm${RESTY_FAT_DEB_FLAVOR}${RESTY_FAT_DEB_VERSION} \ + && rm -rf /var/lib/apt/lists/*