Skip to content

Commit

Permalink
fix(deb): revert repack
Browse files Browse the repository at this point in the history
  • Loading branch information
curiositycasualty committed Sep 22, 2023
1 parent 2380389 commit 110a7a4
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions Dockerfile.deb
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,25 @@ RUN set -ex; \
arch="$(dpkg --print-architecture)"; \
major_minor="$(echo "${KONG_VERSION%.*}" | tr -d '.')"; \
apt-get update; \
apt-get install -y curl zstd xz-utils binutils; \
apt-get install -y curl; \
if [ "$ASSET" = "remote" ] ; then \
CODENAME=$(grep VERSION_CODENAME /etc/os-release | cut -d'=' -f2) \
&& DOWNLOAD_URL="https://packages.konghq.com/public/gateway-${major_minor}/deb/debian/pool/${CODENAME}/main/k/ko/kong_${KONG_VERSION}/kong_${KONG_VERSION}_$arch.deb" \
CODENAME=$(cat /etc/os-release | grep VERSION_CODENAME | cut -d = -f 2) \
&& DOWNLOAD_URL="https://packages.konghq.com/public/gateway-${major_minor}/deb/debian/pool/${CODENAME}/main/k/ko/kong_${KONG_VERSION}/kong_${KONG_VERSION}_${arch}.deb" \
&& curl -fL "$DOWNLOAD_URL" -o /tmp/kong.deb \
&& echo "${KONG_SHA256} /tmp/kong.deb" | sha256sum -c -; \
fi \
&& if grep -E -qs 'buster|bullseye|xenial|bionic' /etc/os-release ; then \
echo "older deb systems don't support zstd compression"; \
echo "repack using xz compression instead" \
&& ar -x /tmp/kong.deb \
&& zstd -d < control.tar.zst | xz > control.tar.xz \
&& zstd -d < data.tar.zst | xz > data.tar.xz \
&& ar -m -c -a sdsd /tmp/kong-repack.deb debian-binary control.tar.xz data.tar.xz \
&& rm debian-binary control.* data.* \
&& apt-get install --yes /tmp/kong-repack.deb; \
else \
apt-get install --yes /tmp/kong.deb; \
fi \
&& apt-get update \
&& apt-get install --yes /tmp/kong.deb \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*.deb \
&& rm -rf /tmp/kong.deb \
&& chown kong:0 /usr/local/bin/kong \
&& chown -R kong:0 ${KONG_PREFIX} \
&& 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 \
&& kong version \
&& apt-get purge curl zstd xz-utils binutils -y
&& apt-get purge curl -y

COPY docker-entrypoint.sh /docker-entrypoint.sh

Expand Down

0 comments on commit 110a7a4

Please sign in to comment.