Skip to content

Commit e37125e

Browse files
authored
Merge pull request #1566 from tkan145/ubi-9
THREESCALE-11901 - Upgrade to ubi-9
2 parents 6a3ba60 + 5f3ae88 commit e37125e

12 files changed

Lines changed: 207 additions & 211 deletions

.circleci/config.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ commands:
2626
steps:
2727
- restore_cache:
2828
keys:
29-
- apicast-cpanm-v2-{{ arch }}-{{ checksum "gateway/cpanfile.snapshot" }}
30-
- apicast-cpanm-v2-{{ arch }}-{{ .Branch }}
31-
- apicast-cpanm-v2-{{ arch }}-master
29+
- apicast-cpanm-v3-{{ arch }}-{{ checksum "gateway/cpanfile.snapshot" }}
30+
- apicast-cpanm-v3-{{ arch }}-{{ .Branch }}
31+
- apicast-cpanm-v3-{{ arch }}-master
3232

3333
setup-docker:
3434
steps:
@@ -105,7 +105,7 @@ executors:
105105
openresty:
106106
working_directory: /opt/app-root/apicast
107107
docker:
108-
- image: quay.io/3scale/apicast-ci:openresty-1.21.4-4
108+
- image: quay.io/3scale/apicast-ci:openresty-1.21.4-5
109109
- image: mirror.gcr.io/library/redis
110110
environment:
111111
TEST_NGINX_BINARY: openresty
@@ -180,7 +180,7 @@ jobs:
180180
- restore-perl-cache
181181
- run: make carton
182182
- save_cache:
183-
key: apicast-cpanm-v2-{{ arch }}-{{ checksum "gateway/cpanfile.snapshot" }}
183+
key: apicast-cpanm-v3-{{ arch }}-{{ checksum "gateway/cpanfile.snapshot" }}
184184
<<: *perl-cache-paths
185185
- persist_to_workspace:
186186
root: .

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
### Added
1515
- Update APIcast schema manifest [PR #1550](https://github.com/3scale/APIcast/pull/1550)
1616
- Update luarocks to v3.12.0 [PR #1555](https://github.com/3scale/APIcast/pull/1555)
17+
- Update base image to ubi9-minimal [PR #1566](https://github.com/3scale/APIcast/pull/1566) [THREESCALE-11901](https://issues.redhat.com/browse/THREESCALE-11901)
1718

1819
### Removed
1920

Dockerfile

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
FROM registry.access.redhat.com/ubi8
1+
FROM registry.access.redhat.com/ubi9/ubi-minimal
22

3-
ARG OPENRESTY_RPM_VERSION="1.21.4-1.el8"
4-
ARG LUAROCKS_VERSION="3.11.1"
5-
ARG JAEGERTRACING_CPP_CLIENT_RPM_VERSION="0.3.1-13.el8"
3+
ARG OPENRESTY_RPM_VERSION="1.21.4-4.el9"
4+
ARG LUAROCKS_VERSION="3.12.0"
65

76
LABEL summary="The 3scale API gateway (APIcast) is an OpenResty application, which consists of two parts: NGINX configuration and Lua files." \
87
description="APIcast is not a standalone API gateway therefore it needs connection to the 3scale API management platform. The container includes OpenResty and uses LuaRocks to install dependencies (rocks are installed in the application folder)." \
@@ -18,23 +17,18 @@ ENV AUTO_UPDATE_INTERVAL=0 \
1817
# The $HOME is not set by default, but some applications needs this variable
1918
HOME=/opt/app-root/src \
2019
PATH=/opt/app-root/src/bin:/opt/app-root/bin:$PATH \
21-
PLATFORM="el8"
20+
PLATFORM="el9"
2221

23-
RUN PKGS="perl-interpreter-5.26.3 libyaml-devel-0.1.7 m4 openssl-devel git gcc make curl" && \
24-
mkdir -p "$HOME" && \
25-
yum -y --setopt=tsflags=nodocs install $PKGS && \
26-
rpm -V $PKGS && \
27-
yum clean all -y
28-
29-
RUN dnf install -y 'dnf-command(config-manager)'
22+
RUN microdnf update -y \
23+
&& microdnf install -y 'yum-utils'
3024

31-
RUN yum config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo
25+
RUN yum-config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo
3226

3327
RUN PKGS="openresty-resty-${OPENRESTY_RPM_VERSION} openresty-opentelemetry-${OPENRESTY_RPM_VERSION} openresty-${OPENRESTY_RPM_VERSION} luarocks-${LUAROCKS_VERSION}" && \
3428
mkdir -p "$HOME" && \
35-
yum -y --setopt=tsflags=nodocs install $PKGS && \
29+
microdnf -y --setopt=tsflags=nodocs install $PKGS && \
3630
rpm -V $PKGS && \
37-
yum clean all -y
31+
microdnf clean all -y
3832

3933
COPY site_config.lua /usr/share/lua/5.1/luarocks/site_config.lua
4034
COPY config-*.lua /usr/local/openresty/config-5.1.lua
@@ -61,18 +55,12 @@ RUN luarocks install --deps-mode=none --tree /usr/local https://luarocks.org/man
6155
RUN luarocks install --deps-mode=none --tree /usr/local https://luarocks.org/manifests/golgote/net-url-0.9-1.src.rock
6256
RUN luarocks install --deps-mode=none --tree /usr/local https://luarocks.org/manifests/membphis/lua-resty-ipmatcher-0.6.1-0.src.rock
6357
RUN luarocks install --deps-mode=none --tree /usr/local https://luarocks.org/manifests/fffonion/lua-resty-openssl-1.5.1-1.src.rock
58+
RUN luarocks install --deps-mode=none --tree /usr/local https://luarocks.org/manifests/tkan145/lua-resty-jwt-0.2.4-0.src.rock
6459

65-
# Install lua-resty-jwt from source due to Authentication Bypass bug
66-
# See https://github.com/cdbattags/lua-resty-jwt/issues/61
67-
RUN cd /tmp \
68-
&& git clone --recurse-submodules https://github.com/cdbattags/lua-resty-jwt \
69-
&& cd lua-resty-jwt \
70-
&& git reset --hard d1558e2 \
71-
&& luarocks make --tree /usr/local lua-resty-jwt-dev-0.rockspec
72-
73-
RUN yum -y remove libyaml-devel m4 openssl-devel git gcc luarocks && \
74-
rm -rf /var/cache/yum && yum clean all -y && \
75-
rm -rf ./*
60+
RUN microdnf -y remove yum-utils luarocks \
61+
&& rm -rf /var/cache/yum /var/cache/dnf \
62+
&& microdnf clean all -y \
63+
&& rm -rf ./*
7664

7765
COPY gateway/. /opt/app-root/src/
7866

Dockerfile.devel

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,32 @@
1-
FROM registry.access.redhat.com/ubi8
1+
FROM registry.access.redhat.com/ubi9/ubi-minimal
22

3-
ARG OPENRESTY_RPM_VERSION="1.21.4-1.el8"
3+
ARG OPENRESTY_RPM_VERSION="1.21.4-4.el9"
44
ARG LUAROCKS_VERSION="3.12.0"
5-
ARG JAEGERTRACING_CPP_CLIENT_RPM_VERSION="0.3.1-13.el8"
65
ARG LUAROVER_VERSION="0.2.3"
76

87
WORKDIR /tmp
98

109
ENV APP_ROOT=/opt/app-root \
1110
HOME=/opt/app-root/src \
1211
PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
13-
PLATFORM="el8"
12+
PLATFORM="el9"
1413

15-
RUN sed -i s/enabled=./enabled=0/g /etc/yum/pluginconf.d/subscription-manager.conf
14+
RUN microdnf update -y \
15+
&& microdnf install -y 'yum-utils'
1616

17-
RUN yum upgrade -y
18-
19-
RUN dnf install -y 'dnf-command(config-manager)'
20-
21-
RUN yum install -y \
22-
gcc make git which curl iputils bind-utils expat-devel kernel-headers openssl-devel m4 \
23-
libyaml libyaml-devel perl-local-lib perl-App-cpanminus perl-LWP-Protocol-https
17+
RUN microdnf install -y \
18+
gcc make git which iputils bind-utils expat-devel kernel-headers openssl-devel m4 \
19+
libyaml libyaml-devel perl-local-lib perl-App-cpanminus perl-LWP-Protocol-https \
20+
tar
2421

2522
# perl-Test-Nginx
2623
RUN cpanm --notest IPC::Run && \
2724
cpanm https://cpan.metacpan.org/authors/id/A/AG/AGENT/Test-Nginx-0.29.tar.gz && \
28-
cpanm https://cpan.metacpan.org/authors/id/O/OA/OALDERS/LWP-Protocol-https-6.14.tar.gz
25+
cpanm https://cpan.metacpan.org/authors/id/O/OA/OALDERS/LWP-Protocol-https-6.15.tar.gz
2926

30-
RUN yum config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo
27+
RUN yum-config-manager --add-repo http://packages.dev.3sca.net/dev_packages_3sca_net.repo
3128

32-
RUN yum install -y \
29+
RUN microdnf install -y \
3330
openresty-${OPENRESTY_RPM_VERSION} \
3431
openresty-resty-${OPENRESTY_RPM_VERSION} \
3532
openresty-opentelemetry-${OPENRESTY_RPM_VERSION}
@@ -57,16 +54,16 @@ RUN cd /tmp \
5754
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
5855
&& make build \
5956
&& make install \
60-
&& luarocks install luaossl 20200709 --tree ${APP_ROOT}/lua_modules CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1" \
57+
# && luarocks install luaossl 20200709 --tree ${APP_ROOT}/lua_modules CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1" \
6158
&& luarocks install http --tree ${APP_ROOT}/lua_modules \
6259
&& cd /tmp \
6360
&& rm -rf luarocks-${LUAROCKS_VERSION} luarocks-${LUAROCKS_VERSION}.tar.gz \
6461
&& curl -fSL https://github.com/3scale/lua-rover/archive/refs/tags/v${LUAROVER_VERSION}.tar.gz -o lua-rover-v${LUAROVER_VERSION}.tar.gz \
6562
&& tar xzf lua-rover-v${LUAROVER_VERSION}.tar.gz \
6663
&& cd lua-rover-${LUAROVER_VERSION} \
6764
&& luarocks make \
68-
&& yum -y remove luarocks \
69-
&& rm -rf /var/cache/yum && yum clean all -y
65+
&& rm -rf /var/cache/yum /var/cache/dnf \
66+
&& microdnf clean all -y
7067

7168
# Directory with the sources is set as the working directory so all STI scripts
7269
# can execute relative to this path.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ NPROC ?= $(firstword $(shell nproc 2>/dev/null) 1)
1313

1414
SEPARATOR="\n=============================================\n"
1515

16-
DEVEL_IMAGE ?= quay.io/3scale/apicast-ci:openresty-1.21.4-4
16+
DEVEL_IMAGE ?= quay.io/3scale/apicast-ci:openresty-1.21.4-5
1717
DEVEL_DOCKERFILE ?= Dockerfile.devel
1818

1919
RUNTIME_IMAGE ?= quay.io/3scale/apicast:latest

docker-compose-devel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
version: '2.2'
33
services:
44
development:
5-
image: ${IMAGE:-quay.io/3scale/apicast-ci:openresty-1.21.4-4}
5+
image: ${IMAGE:-quay.io/3scale/apicast-ci:openresty-1.21.4-5}
66
platform: "linux/amd64"
77
depends_on:
88
- redis

gateway/cpanfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ requires 'JSON';
66
requires 'URI::data';
77
requires 'TAP::Harness::JUnit';
88
requires 'Data::Inspect';
9-
requires 'YAML';

0 commit comments

Comments
 (0)