From 9a7b3228a2b1eac63ac1bb9ccc8603571ec52e75 Mon Sep 17 00:00:00 2001 From: Sarath Chandra Oruganti Date: Fri, 15 Mar 2024 11:10:26 -0500 Subject: [PATCH] fix build args fluentd image Signed-off-by: Sarath Chandra Oruganti --- Makefile | 2 +- cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 903b91de1..4d68f7da2 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ build-fd-arm64-base: prepare-build # Use docker buildx to build arm64 Fluentd container image build-fd-arm64: prepare-build - docker buildx build --push --platform linux/arm64 -f cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick . -t ${FD_IMG}${ARCH} + docker buildx build --push --platform linux/arm64 -f cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick . -t ${FD_IMG}${ARCH} --build-arg ${FD_IMG_BASE} --build-arg ${FD_IMG_BASE_TAG} # Prepare for arm64 building prepare-build: diff --git a/cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick b/cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick index 97946813d..58b823c36 100644 --- a/cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick +++ b/cmd/fluent-watcher/fluentd/Dockerfile.arm64.quick @@ -1,3 +1,5 @@ +ARG BASE_IMAGE=kubesphere/fluentd +ARG BASE_IMAGE_TAG=latest-arm64-base # Fluentd watcher agent FROM golang:1.20.4-alpine3.16 as buildergo RUN mkdir -p /fluentd @@ -8,8 +10,8 @@ RUN echo $(ls -al /code) RUN CGO_ENABLED=0 go build -ldflags '-w -s' -o /fluentd/fluentd-watcher /code/cmd/fluent-watcher/fluentd/main.go # Fluentd main image -FROM kubesphere/fluentd:v1.15.3-arm64-base -LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.15.3" +FROM ${BASE_IMAGE}:${BASE_IMAGE_TAG} +LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version=${BASE_IMAGE_TAG} ENV TINI_VERSION=0.18.0 # Do not split this into multiple RUN! @@ -46,4 +48,4 @@ COPY ./cmd/fluent-watcher/fluentd/app/app.conf /fluentd/etc/ # copy the output in buildergo COPY --from=buildergo /fluentd/fluentd-watcher /fluentd/bin/fluentd-watcher # Entry point -ENTRYPOINT ["/fluentd/bin/fluentd-watcher"] \ No newline at end of file +ENTRYPOINT ["/fluentd/bin/fluentd-watcher"]