Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Added
- Update APIcast schema manifest [PR #1550](https://github.com/3scale/APIcast/pull/1550)
- Update luarocks to v3.12.0 [PR #1555](https://github.com/3scale/APIcast/pull/1555)
- Update base image to ubi9-minimal [PR #1566](https://github.com/3scale/APIcast/pull/1566) [THREESCALE-11901](https://issues.redhat.com/browse/THREESCALE-11901)

### Removed

Expand Down
34 changes: 11 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM registry.access.redhat.com/ubi8
FROM registry.access.redhat.com/ubi9/ubi-minimal

ARG OPENRESTY_RPM_VERSION="1.21.4-1.el8"
ARG LUAROCKS_VERSION="3.11.1"
ARG JAEGERTRACING_CPP_CLIENT_RPM_VERSION="0.3.1-13.el8"

LABEL summary="The 3scale API gateway (APIcast) is an OpenResty application, which consists of two parts: NGINX configuration and Lua files." \
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)." \
Expand All @@ -20,21 +19,16 @@ ENV AUTO_UPDATE_INTERVAL=0 \
PATH=/opt/app-root/src/bin:/opt/app-root/bin:$PATH \
PLATFORM="el8"

RUN PKGS="perl-interpreter-5.26.3 libyaml-devel-0.1.7 m4 openssl-devel git gcc make curl" && \
mkdir -p "$HOME" && \
yum -y --setopt=tsflags=nodocs install $PKGS && \
rpm -V $PKGS && \
yum clean all -y

RUN dnf install -y 'dnf-command(config-manager)'
RUN microdnf update -y \
&& microdnf install -y 'yum-utils' dnf

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

RUN PKGS="openresty-resty-${OPENRESTY_RPM_VERSION} openresty-opentelemetry-${OPENRESTY_RPM_VERSION} openresty-${OPENRESTY_RPM_VERSION} luarocks-${LUAROCKS_VERSION}" && \
mkdir -p "$HOME" && \
yum -y --setopt=tsflags=nodocs install $PKGS && \
dnf -y --setopt=tsflags=nodocs install $PKGS && \
rpm -V $PKGS && \
yum clean all -y
dnf clean all -y

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

# Install lua-resty-jwt from source due to Authentication Bypass bug
# See https://github.com/cdbattags/lua-resty-jwt/issues/61
RUN cd /tmp \
&& git clone --recurse-submodules https://github.com/cdbattags/lua-resty-jwt \
&& cd lua-resty-jwt \
&& git reset --hard d1558e2 \
&& luarocks make --tree /usr/local lua-resty-jwt-dev-0.rockspec

RUN yum -y remove libyaml-devel m4 openssl-devel git gcc luarocks && \
rm -rf /var/cache/yum && yum clean all -y && \
rm -rf ./*
RUN dnf -y remove yum-utils luarocks \
&& rm -rf /var/cache/yum /var/cache/dnf \
&& dnf clean all -y \
&& rm -rf ./*

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

Expand Down
27 changes: 13 additions & 14 deletions Dockerfile.devel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8
FROM registry.access.redhat.com/ubi9/ubi-minimal

ARG OPENRESTY_RPM_VERSION="1.21.4-1.el8"
ARG LUAROCKS_VERSION="3.12.0"
Expand All @@ -12,24 +12,22 @@ ENV APP_ROOT=/opt/app-root \
PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
PLATFORM="el8"

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

RUN yum upgrade -y

RUN dnf install -y 'dnf-command(config-manager)'

RUN yum install -y \
gcc make git which curl iputils bind-utils expat-devel kernel-headers openssl-devel m4 \
libyaml libyaml-devel perl-local-lib perl-App-cpanminus perl-LWP-Protocol-https
RUN dnf install -y \
gcc make git which iputils bind-utils expat-devel kernel-headers openssl-devel m4 \
libyaml libyaml-devel perl-local-lib perl-App-cpanminus perl-LWP-Protocol-https \
tar

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

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

RUN yum install -y \
RUN dnf install -y \
openresty-${OPENRESTY_RPM_VERSION} \
openresty-resty-${OPENRESTY_RPM_VERSION} \
openresty-opentelemetry-${OPENRESTY_RPM_VERSION}
Expand Down Expand Up @@ -57,16 +55,17 @@ RUN cd /tmp \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1 \
&& make build \
&& make install \
&& luarocks install luaossl 20200709 --tree ${APP_ROOT}/lua_modules CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1" \
# && luarocks install luaossl 20200709 --tree ${APP_ROOT}/lua_modules CFLAGS="-O2 -fPIC -DHAVE_EVP_KDF_CTX=1" \
&& luarocks install http --tree ${APP_ROOT}/lua_modules \
&& cd /tmp \
&& rm -rf luarocks-${LUAROCKS_VERSION} luarocks-${LUAROCKS_VERSION}.tar.gz \
&& curl -fSL https://github.com/3scale/lua-rover/archive/refs/tags/v${LUAROVER_VERSION}.tar.gz -o lua-rover-v${LUAROVER_VERSION}.tar.gz \
&& tar xzf lua-rover-v${LUAROVER_VERSION}.tar.gz \
&& cd lua-rover-${LUAROVER_VERSION} \
&& luarocks make \
&& yum -y remove luarocks \
&& rm -rf /var/cache/yum && yum clean all -y
&& dnf -y remove luarocks \
&& rm -rf /var/cache/yum /var/cache/dnf \
&& dnf clean all -y

# Directory with the sources is set as the working directory so all STI scripts
# can execute relative to this path.
Expand Down
1 change: 0 additions & 1 deletion gateway/cpanfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ requires 'JSON';
requires 'URI::data';
requires 'TAP::Harness::JUnit';
requires 'Data::Inspect';
requires 'YAML';
Loading