forked from Kong/docker-kong
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Kong#576 from Kong/chore/ubi-minimal
[FT-2378] [ENGEN-452] Use ubi-minimal and add "rhel-minimal" image
- Loading branch information
Showing
13 changed files
with
443 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ jobs: | |
test: | ||
name: Build & Test Version 2 | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 30 | ||
|
||
strategy: | ||
matrix: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,6 @@ kong-build-tools | |
kong | ||
*.bak | ||
submit | ||
**/*.deb | ||
**/*.rpm | ||
**/*.apk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,22 @@ | ||
FROM redhat/ubi8 | ||
FROM redhat/ubi8-minimal | ||
|
||
LABEL maintainer="Kong Docker Maintainers <[email protected]> (@team-gateway-bot)" | ||
|
||
ARG KONG_VERSION=2.8.1 | ||
ENV KONG_VERSION $KONG_VERSION | ||
|
||
# RedHat required labels | ||
LABEL name="Kong" \ | ||
vendor="Kong" \ | ||
version="$KONG_VERSION" \ | ||
release="1" \ | ||
url="https://konghq.com" \ | ||
summary="Next-Generation API Platform for Modern Architectures" \ | ||
description="Next-Generation API Platform for Modern Architectures" | ||
|
||
# RedHat required LICENSE file approved path | ||
COPY LICENSE /licenses/ | ||
|
||
ARG KONG_SHA256="8bae61982b8d439e12037e24432adc185f87113989c27c89521d8cc024b38ddc" | ||
|
||
ARG ASSET=remote | ||
|
@@ -13,12 +27,24 @@ COPY kong.rpm /tmp/kong.rpm | |
# hadolint ignore=DL3015 | ||
RUN set -ex; \ | ||
if [ "$ASSET" = "remote" ] ; then \ | ||
VERSION=$(grep '^VERSION_ID' /etc/os-release | cut -d = -f 2 | sed -e 's/^"//' -e 's/"$//' | cut -d . -f 1) \ | ||
VERSION=$(sed -n -e 's/^VERSION_ID="\(.*\)\.[0-9]"/\1/p' /etc/os-release) \ | ||
&& DOWNLOAD_URL="https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-rhel-$VERSION/Packages/k/kong-$KONG_VERSION.rhel$VERSION.amd64.rpm" \ | ||
&& curl -fL $DOWNLOAD_URL -o /tmp/kong.rpm \ | ||
&& echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -; \ | ||
fi \ | ||
&& yum install -y /tmp/kong.rpm \ | ||
# findutils provides xargs (temporarily) | ||
&& microdnf install --assumeyes --nodocs \ | ||
findutils \ | ||
shadow-utils \ | ||
unzip \ | ||
&& rpm -qpR /tmp/kong.rpm \ | ||
| grep -v rpmlib \ | ||
| xargs -n1 -t microdnf install --assumeyes --nodocs \ | ||
# Please update the rhel install docs if the below line is changed so that | ||
# end users can properly install Kong along with its required dependencies | ||
# and that our CI does not diverge from our docs. | ||
&& rpm -iv /tmp/kong.rpm \ | ||
&& microdnf -y clean all \ | ||
&& rm /tmp/kong.rpm \ | ||
&& chown kong:0 /usr/local/bin/kong \ | ||
&& chown -R kong:0 /usr/local/kong \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
ARG RHEL_VERSION=7 | ||
|
||
FROM registry.access.redhat.com/ubi${RHEL_VERSION}/ubi-minimal | ||
|
||
LABEL maintainer="Kong Docker Maintainers <[email protected]> (@team-gateway-bot)" | ||
|
||
ARG KONG_VERSION=2.8.1 | ||
ENV KONG_VERSION $KONG_VERSION | ||
|
||
ARG KONG_SHA256="4f2d073122c97be80de301e6037d0913f15de1d8bb6eea2871542e9a4c164c72" | ||
|
||
# RedHat required labels | ||
LABEL name="Kong" \ | ||
vendor="Kong" \ | ||
version="$KONG_VERSION" \ | ||
release="1" \ | ||
url="https://konghq.com" \ | ||
summary="Next-Generation API Platform for Modern Architectures" \ | ||
description="Next-Generation API Platform for Modern Architectures" | ||
|
||
# RedHat required LICENSE file approved path | ||
COPY LICENSE /licenses/ | ||
|
||
ARG ASSET=ce | ||
ENV ASSET $ASSET | ||
|
||
ARG EE_PORTS | ||
|
||
COPY kong.rpm /tmp/kong.rpm | ||
|
||
ARG RHEL_VERSION | ||
ENV RHEL_VERSION $RHEL_VERSION | ||
|
||
RUN set -ex; \ | ||
if [ "$ASSET" = "ce" ] ; then \ | ||
curl -fL "https://download.konghq.com/gateway-${KONG_VERSION%%.*}.x-rhel-${RHEL_VERSION}/Packages/k/kong-${KONG_VERSION}.rhel${RHEL_VERSION}.amd64.rpm" -o /tmp/kong.rpm \ | ||
&& echo "$KONG_SHA256 /tmp/kong.rpm" | sha256sum -c -; \ | ||
else \ | ||
microdnf update -y ; \ | ||
fi \ | ||
# findutils provides xargs (temporarily) | ||
&& microdnf install --assumeyes --nodocs \ | ||
findutils \ | ||
shadow-utils \ | ||
unzip \ | ||
&& rpm -qpR /tmp/kong.rpm \ | ||
| grep -v rpmlib \ | ||
| xargs -n1 -t microdnf install --assumeyes --nodocs \ | ||
&& rm -fr /var/cache/yum/* /tmp/yum_save*.yumtx /root/.pki \ | ||
# Please update the rhel install docs if the below line is changed so that | ||
# end users can properly install Kong along with its required dependencies | ||
# and that our CI does not diverge from our docs. | ||
&& rpm -iv /tmp/kong.rpm \ | ||
&& microdnf clean all \ | ||
&& rm /tmp/kong.rpm \ | ||
&& chown kong:0 /usr/local/bin/kong \ | ||
&& chown -R kong:0 /usr/local/kong \ | ||
&& ln -s /usr/local/openresty/bin/resty /usr/local/bin/resty \ | ||
&& ln -s /usr/local/openresty/luajit/bin/luajit /usr/local/bin/luajit \ | ||
&& ln -s /usr/local/openresty/luajit/bin/luajit /usr/local/bin/lua \ | ||
&& ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx \ | ||
# ubi-minimal comes with libz in /usr/lib64 but is sometimes missing the | ||
# symlink from the versioned filenames to the unversioned.. version | ||
# lua-ffi-zlib expects, and the zlib-devel pkg previously provided libz.so | ||
&& [ -s /usr/lib64/libz.so ] || ln -vs /usr/lib64/libz.so.1 /usr/lib64/libz.so \ | ||
&& kong version | ||
|
||
COPY docker-entrypoint.sh /docker-entrypoint.sh | ||
|
||
USER kong | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
EXPOSE 8000 8443 8001 8444 $EE_PORTS | ||
|
||
STOPSIGNAL SIGQUIT | ||
|
||
HEALTHCHECK --interval=10s --timeout=10s --retries=10 CMD kong health | ||
|
||
CMD ["kong", "docker-start"] |
Oops, something went wrong.