Skip to content

Commit

Permalink
chore: divide dockerfile RUN command
Browse files Browse the repository at this point in the history
This will increase the layers in the docker container thereby
improving docker image scan for vulnerabilities.
  • Loading branch information
shreemaan-abhishek committed Sep 28, 2023
1 parent c129ef5 commit 1b0be05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ ARG APISIX_VERSION=3.5.0
RUN set -ex; \
arch=$(dpkg --print-architecture); \
apt update; \
apt-get -y install --no-install-recommends wget gnupg ca-certificates curl;\
codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`; \
apt-get -y install --no-install-recommends wget gnupg ca-certificates curl;

RUN codename=`grep -Po 'VERSION="[0-9]+ \(\K[^)]+' /etc/os-release`; \
wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -; \
case "${arch}" in \
amd64) \
Expand All @@ -36,8 +37,9 @@ RUN set -ex; \
&& wget -O - https://repos.apiseven.com/pubkey.gpg | apt-key add - \
&& echo "deb https://repos.apiseven.com/packages/arm64/debian $codename main" | tee /etc/apt/sources.list.d/apisix.list \
;; \
esac; \
apt update \
esac;

RUN apt update \
&& apt install -y apisix=${APISIX_VERSION}-0 \
&& apt-get purge -y --auto-remove \
&& rm -f /etc/apt/sources.list.d/openresty.list /etc/apt/sources.list.d/apisix.list \
Expand Down

0 comments on commit 1b0be05

Please sign in to comment.