From c34e97ed3051352cd8fd90ac256c62a63eece958 Mon Sep 17 00:00:00 2001 From: rongxin Date: Mon, 24 Mar 2025 17:44:59 +0800 Subject: [PATCH 1/3] chore: upgrade adc to 0.18.0 --- Dockerfile | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 194091a51..7aca1ccbf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,26 @@ ARG ENABLE_PROXY=false ARG BASE_IMAGE_TAG=nonroot -ARG ADC_VERSION=0.17.0 -ARG TARGETARCH -FROM golang:1.22 AS builder +FROM debian:bullseye-slim AS deps WORKDIR /workspace -COPY go.* ./ - -RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w GOPROXY=https://goproxy.cn,direct ; fi \ - && go mod download -COPY . . - -RUN --mount=type=cache,target=/root/.cache/go-build make build && mv bin/api7-ingress-controller /bin && rm -rf /workspace +ARG ADC_VERSION=0.18.0 +ARG TARGETARCH -RUN wget https://github.com/api7/adc/releases/download/v${ADC_VERSION}/adc-v${ADC_VERSION}-linux-${TARGETARCH}.tar.gz \ - && tar -zxvf adc-v${ADC_VERSION}-linux-${TARGETARCH}.tar.gz \ - && mv adc-v${ADC_VERSION}-linux-${TARGETARCH}/adc /bin \ - && rm -rf adc-v${ADC_VERSION}-linux-${TARGETARCH}.tar.gz adc-v${ADC_VERSION}-linux-${TARGETARCH} +RUN apt update \ + && apt install -y wget \ + && wget https://github.com/api7/adc/releases/download/v${ADC_VERSION}/adc_${ADC_VERSION}_linux_${TARGETARCH}.tar.gz -O adc.tar.gz \ + && tar -zxvf adc.tar.gz \ + && mv adc /bin/adc \ + && rm -rf adc.tar.gz \ + && apt autoremove -y wget FROM gcr.io/distroless/static-debian12:${BASE_IMAGE_TAG} WORKDIR /app -COPY --from=builder /bin/api7-ingress-controller . -COPY --from=builder /bin/adc /bin/adc -COPY config/samples/config.yaml ./conf/config.yaml +COPY --from=deps /bin/adc /bin/adc +COPY ./bin/api7-ingress-controller . +COPY ./config/samples/config.yaml ./conf/config.yaml ENTRYPOINT ["/app/api7-ingress-controller"] CMD ["-c", "/app/conf/config.yaml"] From e7fdfebdb54c4685b27a9a7f5fc883dc3bed2d0a Mon Sep 17 00:00:00 2001 From: AlinsRan Date: Tue, 25 Mar 2025 01:02:07 +0000 Subject: [PATCH 2/3] add makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 02ded7125..45032f5ce 100644 --- a/Makefile +++ b/Makefile @@ -159,7 +159,7 @@ run: manifests generate fmt vet ## Run a controller from your host. # More info: https://docs.docker.com/develop/develop-images/build_enhancements/ .PHONY: docker-build docker-build: build ## Build docker image with the manager. - $(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile.dev . + $(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile . .PHONY: docker-push docker-push: ## Push docker image with the manager. From 4deaa09e4018b26446888bc170b796db7c9fe461 Mon Sep 17 00:00:00 2001 From: rongxin Date: Tue, 25 Mar 2025 11:39:06 +0800 Subject: [PATCH 3/3] fix from imaage --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7aca1ccbf..303ce963f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN apt update \ && rm -rf adc.tar.gz \ && apt autoremove -y wget -FROM gcr.io/distroless/static-debian12:${BASE_IMAGE_TAG} +FROM gcr.io/distroless/cc-debian12:${BASE_IMAGE_TAG} WORKDIR /app COPY --from=deps /bin/adc /bin/adc