File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 1- ARG IMAGE_BASE="ubuntu "
2- ARG IMAGE_TAG="20.04 "
1+ ARG IMAGE_BASE="debian "
2+ ARG IMAGE_TAG="bullseye-slim "
33
4- FROM ${IMAGE_BASE}:${IMAGE_TAG}
4+ FROM ${IMAGE_BASE}:${IMAGE_TAG} as build
55
66COPY ./utils/build-common.sh /tmp/build-common.sh
77COPY build-apisix-base.sh /tmp/build-apisix-base.sh
@@ -22,3 +22,8 @@ ENV build_latest=${BUILD_LATEST:-}
2222RUN ./build-common.sh build_apisix_base_deb ${build_latest} \
2323 # determine dist and write it into /tmp/dist file
2424 && /tmp/determine-dist.sh
25+
26+ FROM ${IMAGE_BASE}:${IMAGE_TAG} as prod
27+
28+ COPY --from=build /usr/local /usr/local
29+ COPY --from=build /tmp/dist /tmp/dist
Original file line number Diff line number Diff line change @@ -39,12 +39,19 @@ build_apisix_base_deb() {
3939 DEBIAN_FRONTEND=noninteractive apt-get install -y sudo git libreadline-dev lsb-release libssl-dev perl build-essential
4040 DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends wget gnupg ca-certificates
4141 wget -O - https://openresty.org/package/pubkey.gpg | apt-key add -
42- echo " deb http://openresty.org/package/${arch_path} ubuntu $( lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list
42+
43+ if [[ $IMAGE_BASE == " ubuntu" ]]; then
44+ echo " deb http://openresty.org/package/${arch_path} ubuntu $( lsb_release -sc) main" | tee /etc/apt/sources.list.d/openresty.list
45+ fi
46+
47+ if [[ $IMAGE_BASE == " debian" ]]; then
48+ echo " deb http://openresty.org/package/${arch_path} debian $( lsb_release -sc) openresty" | tee /etc/apt/sources.list.d/openresty.list
49+ fi
50+
4351 DEBIAN_FRONTEND=noninteractive apt-get update
4452 DEBIAN_FRONTEND=noninteractive apt-get install -y openresty-openssl111-dev openresty-pcre-dev openresty-zlib-dev
4553
4654 export_openresty_variables
47-
4855 # fix OR_PREFIX
4956 if [[ $build_latest == " latest" ]]; then
5057 unset OR_PREFIX
You can’t perform that action at this time.
0 commit comments