Skip to content

Commit 8c4d0c1

Browse files
authored
chore: upgrade adc to 0.18.0 (#75)
1 parent e0a1e77 commit 8c4d0c1

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

Dockerfile

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,26 @@
11
ARG ENABLE_PROXY=false
22
ARG BASE_IMAGE_TAG=nonroot
3-
ARG ADC_VERSION=0.17.0
4-
ARG TARGETARCH
53

6-
FROM golang:1.22 AS builder
4+
FROM debian:bullseye-slim AS deps
75
WORKDIR /workspace
8-
COPY go.* ./
9-
10-
RUN if [ "$ENABLE_PROXY" = "true" ] ; then go env -w GOPROXY=https://goproxy.cn,direct ; fi \
11-
&& go mod download
126

13-
COPY . .
14-
15-
RUN --mount=type=cache,target=/root/.cache/go-build make build && mv bin/api7-ingress-controller /bin && rm -rf /workspace
7+
ARG ADC_VERSION=0.18.0
8+
ARG TARGETARCH
169

17-
RUN wget https://github.com/api7/adc/releases/download/v${ADC_VERSION}/adc-v${ADC_VERSION}-linux-${TARGETARCH}.tar.gz \
18-
&& tar -zxvf adc-v${ADC_VERSION}-linux-${TARGETARCH}.tar.gz \
19-
&& mv adc-v${ADC_VERSION}-linux-${TARGETARCH}/adc /bin \
20-
&& rm -rf adc-v${ADC_VERSION}-linux-${TARGETARCH}.tar.gz adc-v${ADC_VERSION}-linux-${TARGETARCH}
10+
RUN apt update \
11+
&& apt install -y wget \
12+
&& wget https://github.com/api7/adc/releases/download/v${ADC_VERSION}/adc_${ADC_VERSION}_linux_${TARGETARCH}.tar.gz -O adc.tar.gz \
13+
&& tar -zxvf adc.tar.gz \
14+
&& mv adc /bin/adc \
15+
&& rm -rf adc.tar.gz \
16+
&& apt autoremove -y wget
2117

22-
FROM gcr.io/distroless/static-debian12:${BASE_IMAGE_TAG}
18+
FROM gcr.io/distroless/cc-debian12:${BASE_IMAGE_TAG}
2319
WORKDIR /app
2420

25-
COPY --from=builder /bin/api7-ingress-controller .
26-
COPY --from=builder /bin/adc /bin/adc
27-
COPY config/samples/config.yaml ./conf/config.yaml
21+
COPY --from=deps /bin/adc /bin/adc
22+
COPY ./bin/api7-ingress-controller .
23+
COPY ./config/samples/config.yaml ./conf/config.yaml
2824

2925
ENTRYPOINT ["/app/api7-ingress-controller"]
3026
CMD ["-c", "/app/conf/config.yaml"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
159159
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
160160
.PHONY: docker-build
161161
docker-build: build ## Build docker image with the manager.
162-
$(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile.dev .
162+
$(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile .
163163

164164
.PHONY: docker-push
165165
docker-push: ## Push docker image with the manager.

0 commit comments

Comments
 (0)