Skip to content

Commit 3782be1

Browse files
authored
Optimize multi-arch docker image build (#838)
* feat: add multi-platform docker builds * fix: restore local runner image tags for ci scans * fix: address multi-arch review feedback
1 parent e726c39 commit 3782be1

File tree

14 files changed

+303
-75
lines changed

14 files changed

+303
-75
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
username: ${{ secrets.DOCKER_USER }}
3838
password: ${{ secrets.DOCKER_PASSWORD }}
3939

40+
- name: Set up Docker Buildx
41+
uses: docker/setup-buildx-action@v3
42+
4043
- name: Set up GO 1.25.8
4144
uses: actions/setup-go@v5
4245
with:
@@ -71,6 +74,7 @@ jobs:
7174
VERSION: ${{ github.event.release.tag_name }}
7275
IMAGE_TAG_BASE: streamnative/function-mesh
7376
CATALOG_BRANCH_TAG: latest
77+
PLATFORMS: linux/amd64,linux/arm64
7478
run: |
7579
# convert vx.y.z to x.y.z because a valid semver is needed in creating the bundle
7680
VERSION=$(echo $VERSION|cut -c 2-)

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Build the manager binary
2-
FROM golang:1.25.8-trixie AS builder
2+
FROM --platform=$BUILDPLATFORM golang:1.25.8-trixie AS builder
3+
4+
ARG TARGETOS
5+
ARG TARGETARCH
36

47
WORKDIR /workspace/api
58
COPY api/ .
@@ -20,7 +23,7 @@ COPY controllers/ controllers/
2023
COPY utils/ utils/
2124

2225
# Build
23-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
26+
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} GO111MODULE=on go build -a -o manager main.go
2427

2528
# Use distroless as minimal base image to package the manager binary
2629
# Refer to https://github.com/GoogleContainerTools/distroless for more details

Makefile

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ GOARCH := $(if $(GOARCH),$(GOARCH),amd64)
2222
GOENV := CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH)
2323
GO := $(GOENV) go
2424
GO_BUILD := $(GO) build -trimpath
25+
PLATFORMS ?= linux/amd64
26+
comma := ,
27+
PLATFORM_LIST := $(subst $(comma), ,$(PLATFORMS))
28+
PRIMARY_PLATFORM := $(word 1,$(PLATFORM_LIST))
29+
MULTI_PLATFORM_BUILD := $(if $(filter 1,$(words $(PLATFORM_LIST))),false,true)
30+
IMAGE_BUILD_PUSH ?= $(MULTI_PLATFORM_BUILD)
2531
GO_MAJOR_VERSION := $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
2632
GO_MINOR_VERSION := $(shell $(GO) version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
2733

@@ -133,15 +139,27 @@ generate: controller-gen
133139

134140
# Build the docker image
135141
docker-build: test
136-
docker build --platform linux/amd64 . -t ${IMG}
142+
ifeq ($(MULTI_PLATFORM_BUILD),true)
143+
docker buildx build --platform $(PLATFORMS) --push -t ${IMG} .
144+
else
145+
docker build --platform $(PRIMARY_PLATFORM) -t ${IMG} .
146+
endif
137147

138148
# Build image for red hat certification
139149
docker-build-redhat:
140-
docker build --platform linux/amd64 -f redhat.Dockerfile . -t ${IMG} --build-arg VERSION=${VERSION} --no-cache
150+
ifeq ($(MULTI_PLATFORM_BUILD),true)
151+
docker buildx build --platform $(PLATFORMS) --push -f redhat.Dockerfile -t ${IMG} --build-arg VERSION=${VERSION} --no-cache .
152+
else
153+
docker build --platform $(PRIMARY_PLATFORM) -f redhat.Dockerfile -t ${IMG} --build-arg VERSION=${VERSION} --no-cache .
154+
endif
141155

142156
# Push the docker image
143157
image-push:
158+
ifeq ($(IMAGE_BUILD_PUSH),true)
159+
@echo "image already pushed during multi-platform build: ${IMG}"
160+
else
144161
docker push ${IMG}
162+
endif
145163

146164
# find or download controller-gen
147165
# download controller-gen if necessary
@@ -171,12 +189,12 @@ bundle: yq kustomize manifests
171189
# Build the bundle image.
172190
.PHONY: bundle-build
173191
bundle-build:
174-
docker build --platform linux/amd64 -f bundle.Dockerfile -t $(BUNDLE_IMG) .
192+
docker build --platform $(PRIMARY_PLATFORM) -f bundle.Dockerfile -t $(BUNDLE_IMG) .
175193

176194
.PHONY: bundle-push
177195
bundle-push: ## Push the bundle image.
178196
echo $(BUNDLE_IMG)
179-
$(MAKE) image-push IMG=$(BUNDLE_IMG)
197+
$(MAKE) image-push IMG=$(BUNDLE_IMG) IMAGE_BUILD_PUSH=false
180198

181199
crd: manifests
182200
$(KUSTOMIZE) build config/crd > manifests/crd.yaml
@@ -186,13 +204,21 @@ rbac: manifests
186204

187205
release: manifests kustomize crd rbac manager operator-docker-image helm-crds
188206

189-
operator-docker-image: manager test
190-
docker build --platform linux/amd64 -f operator.Dockerfile -t $(OPERATOR_IMG) .
207+
operator-docker-image: test
208+
ifeq ($(MULTI_PLATFORM_BUILD),true)
209+
docker buildx build --platform $(PLATFORMS) --push -f operator.Dockerfile -t $(OPERATOR_IMG) -t $(OPERATOR_IMG_LATEST) .
210+
else
211+
docker build --platform $(PRIMARY_PLATFORM) -f operator.Dockerfile -t $(OPERATOR_IMG) .
191212
docker tag $(OPERATOR_IMG) $(OPERATOR_IMG_LATEST)
213+
endif
192214

193215
docker-push:
216+
ifeq ($(MULTI_PLATFORM_BUILD),true)
217+
@echo "operator images already pushed during multi-platform build: $(OPERATOR_IMG), $(OPERATOR_IMG_LATEST)"
218+
else
194219
docker push $(OPERATOR_IMG)
195220
docker push $(OPERATOR_IMG_LATEST)
221+
endif
196222

197223
.PHONY: opm
198224
OPM = ./bin/opm
@@ -240,9 +266,9 @@ endif
240266
# Push the catalog image.
241267
.PHONY: catalog-push
242268
catalog-push: ## Push a catalog image.
243-
$(MAKE) image-push IMG=$(CATALOG_IMG)
269+
$(MAKE) image-push IMG=$(CATALOG_IMG) IMAGE_BUILD_PUSH=false
244270
ifneq ($(origin CATALOG_BRANCH_TAG), undefined)
245-
$(MAKE) image-push IMG=$(CATALOG_BRANCH_IMG)
271+
$(MAKE) image-push IMG=$(CATALOG_BRANCH_IMG) IMAGE_BUILD_PUSH=false
246272
endif
247273

248274
version:
@@ -256,7 +282,11 @@ function-mesh-docker-image-name:
256282

257283
# Build the docker image without tests
258284
docker-build-skip-test:
259-
docker build --platform linux/amd64 . -t ${IMG}
285+
ifeq ($(MULTI_PLATFORM_BUILD),true)
286+
docker buildx build --platform $(PLATFORMS) --push -t ${IMG} .
287+
else
288+
docker build --platform $(PRIMARY_PLATFORM) -t ${IMG} .
289+
endif
260290

261291
e2e: skywalking-e2e yq
262292
$(E2E) run -c .ci/tests/integration/e2e.yaml
@@ -297,17 +327,21 @@ redhat-certificated-bundle: yq kustomize manifests
297327
# Build the bundle image.
298328
.PHONY: redhat-certificated-bundle-build
299329
redhat-certificated-bundle-build:
300-
docker build --platform linux/amd64 -f bundle.Dockerfile -t $(BUNDLE_IMG) .
330+
docker build --platform $(PRIMARY_PLATFORM) -f bundle.Dockerfile -t $(BUNDLE_IMG) .
301331

302332
.PHONY: redhat-certificated-bundle-push
303333
redhat-certificated-bundle-push: ## Push the bundle image.
304334
echo $(BUNDLE_IMG)
305-
$(MAKE) image-push IMG=$(BUNDLE_IMG)
335+
$(MAKE) image-push IMG=$(BUNDLE_IMG) IMAGE_BUILD_PUSH=false
306336

307337
# Build the bundle image.
308338
.PHONY: redhat-certificated-image-build
309339
redhat-certificated-image-build:
310-
docker build --platform linux/amd64 -f redhat.Dockerfile . -t ${OPERATOR_IMG} --build-arg VERSION=${VERSION} --no-cache
340+
ifeq ($(MULTI_PLATFORM_BUILD),true)
341+
docker buildx build --platform $(PLATFORMS) --push -f redhat.Dockerfile -t ${OPERATOR_IMG} --build-arg VERSION=${VERSION} --no-cache .
342+
else
343+
docker build --platform $(PRIMARY_PLATFORM) -f redhat.Dockerfile -t ${OPERATOR_IMG} --build-arg VERSION=${VERSION} --no-cache .
344+
endif
311345

312346
.PHONY: redhat-certificated-image-push
313347
redhat-certificated-image-push: ## Push the bundle image.

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ operator-sdk create api --group compute --version v1alpha1 --kind Function --res
6262
operator-sdk create webhook --group compute.functionmesh.io --version v1alpha1 --kind Function --defaulting --programmatic-validation
6363
```
6464

65+
### Multi-platform images
66+
67+
The image build targets accept `PLATFORMS` as a comma-separated Docker platform list.
68+
69+
```bash
70+
make docker-build PLATFORMS=linux/amd64,linux/arm64
71+
make operator-docker-image PLATFORMS=linux/amd64,linux/arm64
72+
PLATFORMS=linux/amd64,linux/arm64 PUSH=true images/build.sh
73+
```
74+
75+
Single-platform builds still default to `linux/amd64`. Multi-platform builds use `docker buildx` and push a manifest list directly, so they require an authenticated registry session.
76+
6577
## Deployment
6678

6779
1. make sure connected to a kubernetes cluster(gke, mini-kube etc.)

docs/release_proocess.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ git push origin vX.Y.Z
3030
3. Click the release button
3131

3232
Click the release button and draft a new release. When publish the release, the Action CI will automatically trigger the release process, build the corresponding image, and push it to docker_hub.
33+
34+
The release workflow publishes multi-platform Docker images for `linux/amd64` and `linux/arm64`.

images/build.sh

Lines changed: 115 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# specific language governing permissions and limitations
1818
# under the License.
1919
#
20-
set -e
20+
set -euo pipefail
2121

2222
PULSAR_IMAGE=${PULSAR_IMAGE:-"streamnative/sn-platform"}
2323
PULSAR_IMAGE_TAG=${PULSAR_IMAGE_TAG:-"2.7.1"}
@@ -34,53 +34,137 @@ PULSARCTL_PYTHON_RUNNER="pulsar-functions-pulsarctl-python-runner"
3434
RUNNER_TAG=${RUNNER_TAG:-$PULSAR_IMAGE_TAG}
3535
KIND_PUSH=${KIND_PUSH:-false}
3636
CI_TEST=${CI_TEST:-false}
37+
PLATFORMS=${PLATFORMS:-"linux/amd64"}
38+
PRIMARY_PLATFORM=${PLATFORMS%%,*}
39+
RUNNER_BASE_IMAGE="${DOCKER_REPO}/${RUNNER_BASE}:${RUNNER_TAG}"
40+
PULSARCTL_RUNNER_BASE_IMAGE="${DOCKER_REPO}/${PULSARCTL_RUNNER_BASE}:${RUNNER_TAG}"
41+
JAVA_RUNNER_IMAGE="${DOCKER_REPO}/${JAVA_RUNNER}:${RUNNER_TAG}"
42+
PULSARCTL_JAVA_RUNNER_IMAGE="${DOCKER_REPO}/${PULSARCTL_JAVA_RUNNER}:${RUNNER_TAG}"
43+
GO_RUNNER_IMAGE="${DOCKER_REPO}/${GO_RUNNER}:${RUNNER_TAG}"
44+
PULSARCTL_GO_RUNNER_IMAGE="${DOCKER_REPO}/${PULSARCTL_GO_RUNNER}:${RUNNER_TAG}"
45+
PYTHON_RUNNER_IMAGE="${DOCKER_REPO}/${PYTHON_RUNNER}:${RUNNER_TAG}"
46+
PULSARCTL_PYTHON_RUNNER_IMAGE="${DOCKER_REPO}/${PULSARCTL_PYTHON_RUNNER}:${RUNNER_TAG}"
47+
48+
MULTI_PLATFORM=false
49+
if [[ "${PLATFORMS}" == *,* ]]; then
50+
MULTI_PLATFORM=true
51+
fi
52+
53+
PUSH_DEFAULT=false
54+
if [[ "${DOCKER_REPO}" == "localhost:5000" || "${MULTI_PLATFORM}" == "true" ]]; then
55+
PUSH_DEFAULT=true
56+
fi
57+
PUSH=${PUSH:-$PUSH_DEFAULT}
58+
59+
if [[ "${MULTI_PLATFORM}" == "true" && "${PUSH}" != "true" ]]; then
60+
echo "multi-platform builds require PUSH=true so dependent images can resolve their base images" >&2
61+
exit 1
62+
fi
63+
64+
if [[ "${MULTI_PLATFORM}" == "true" && "${KIND_PUSH}" == "true" ]]; then
65+
echo "KIND_PUSH=true is only supported for single-platform builds" >&2
66+
exit 1
67+
fi
68+
69+
build_image() {
70+
local image=$1
71+
local context=$2
72+
shift 2
73+
74+
if [[ "${MULTI_PLATFORM}" == "true" ]]; then
75+
docker buildx build --platform "${PLATFORMS}" --push -t "${image}" "$@" "${context}"
76+
else
77+
docker build --platform "${PRIMARY_PLATFORM}" -t "${image}" "$@" "${context}"
78+
fi
79+
}
80+
81+
tag_local_aliases() {
82+
local source_image=$1
83+
local local_name=$2
84+
85+
if [[ "${MULTI_PLATFORM}" != "true" ]]; then
86+
docker tag "${source_image}" "${local_name}:latest"
87+
fi
88+
}
3789

3890
echo "build runner base"
39-
docker build --platform linux/amd64 -t ${RUNNER_BASE} images/pulsar-functions-base-runner --build-arg PULSAR_IMAGE="$PULSAR_IMAGE" --build-arg PULSAR_IMAGE_TAG="$PULSAR_IMAGE_TAG" --progress=plain
40-
docker build --platform linux/amd64 -t ${PULSARCTL_RUNNER_BASE} images/pulsar-functions-base-runner -f images/pulsar-functions-base-runner/pulsarctl.Dockerfile --build-arg PULSAR_IMAGE="$PULSAR_IMAGE" --build-arg PULSAR_IMAGE_TAG="$PULSAR_IMAGE_TAG" --progress=plain
41-
docker tag ${RUNNER_BASE} "${DOCKER_REPO}"/${RUNNER_BASE}:"${RUNNER_TAG}"
42-
docker tag ${PULSARCTL_RUNNER_BASE} "${DOCKER_REPO}"/${PULSARCTL_RUNNER_BASE}:"${RUNNER_TAG}"
91+
build_image "${RUNNER_BASE_IMAGE}" images/pulsar-functions-base-runner \
92+
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" \
93+
--build-arg PULSAR_IMAGE_TAG="${PULSAR_IMAGE_TAG}" \
94+
--progress=plain
95+
build_image "${PULSARCTL_RUNNER_BASE_IMAGE}" images/pulsar-functions-base-runner \
96+
-f images/pulsar-functions-base-runner/pulsarctl.Dockerfile \
97+
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" \
98+
--build-arg PULSAR_IMAGE_TAG="${PULSAR_IMAGE_TAG}" \
99+
--progress=plain
100+
tag_local_aliases "${RUNNER_BASE_IMAGE}" "${RUNNER_BASE}"
101+
tag_local_aliases "${PULSARCTL_RUNNER_BASE_IMAGE}" "${PULSARCTL_RUNNER_BASE}"
43102

44103
echo "build java runner"
45-
docker build --platform linux/amd64 -t ${JAVA_RUNNER} images/pulsar-functions-java-runner --build-arg PULSAR_IMAGE="$PULSAR_IMAGE" --build-arg PULSAR_IMAGE_TAG="$PULSAR_IMAGE_TAG" --progress=plain
46-
docker build --platform linux/amd64 -t ${PULSARCTL_JAVA_RUNNER} images/pulsar-functions-java-runner -f images/pulsar-functions-java-runner/pulsarctl.Dockerfile --build-arg PULSAR_IMAGE="$PULSAR_IMAGE" --build-arg PULSAR_IMAGE_TAG="$PULSAR_IMAGE_TAG" --progress=plain
47-
docker tag ${JAVA_RUNNER} "${DOCKER_REPO}"/${JAVA_RUNNER}:"${RUNNER_TAG}"
48-
docker tag ${PULSARCTL_JAVA_RUNNER} "${DOCKER_REPO}"/${PULSARCTL_JAVA_RUNNER}:"${RUNNER_TAG}"
104+
build_image "${JAVA_RUNNER_IMAGE}" images/pulsar-functions-java-runner \
105+
--build-arg BASE_IMAGE="${RUNNER_BASE_IMAGE}" \
106+
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" \
107+
--build-arg PULSAR_IMAGE_TAG="${PULSAR_IMAGE_TAG}" \
108+
--progress=plain
109+
build_image "${PULSARCTL_JAVA_RUNNER_IMAGE}" images/pulsar-functions-java-runner \
110+
-f images/pulsar-functions-java-runner/pulsarctl.Dockerfile \
111+
--build-arg BASE_IMAGE="${PULSARCTL_RUNNER_BASE_IMAGE}" \
112+
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" \
113+
--build-arg PULSAR_IMAGE_TAG="${PULSAR_IMAGE_TAG}" \
114+
--progress=plain
115+
tag_local_aliases "${JAVA_RUNNER_IMAGE}" "${JAVA_RUNNER}"
116+
tag_local_aliases "${PULSARCTL_JAVA_RUNNER_IMAGE}" "${PULSARCTL_JAVA_RUNNER}"
49117

50118
echo "build python runner"
51-
docker build --platform linux/amd64 -t ${PYTHON_RUNNER} images/pulsar-functions-python-runner --build-arg PULSAR_IMAGE="$PULSAR_IMAGE" --build-arg PULSAR_IMAGE_TAG="$PULSAR_IMAGE_TAG" --progress=plain
52-
docker build --platform linux/amd64 -t ${PULSARCTL_PYTHON_RUNNER} images/pulsar-functions-python-runner -f images/pulsar-functions-python-runner/pulsarctl.Dockerfile --build-arg PULSAR_IMAGE="$PULSAR_IMAGE" --build-arg PULSAR_IMAGE_TAG="$PULSAR_IMAGE_TAG" --build-arg PYTHON_VERSION="$PYTHON_VERSION" --progress=plain
53-
docker tag ${PYTHON_RUNNER} "${DOCKER_REPO}"/${PYTHON_RUNNER}:"${RUNNER_TAG}"
54-
docker tag ${PULSARCTL_PYTHON_RUNNER} "${DOCKER_REPO}"/${PULSARCTL_PYTHON_RUNNER}:"${RUNNER_TAG}"
119+
build_image "${PYTHON_RUNNER_IMAGE}" images/pulsar-functions-python-runner \
120+
--build-arg BASE_IMAGE="${RUNNER_BASE_IMAGE}" \
121+
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" \
122+
--build-arg PULSAR_IMAGE_TAG="${PULSAR_IMAGE_TAG}" \
123+
--progress=plain
124+
build_image "${PULSARCTL_PYTHON_RUNNER_IMAGE}" images/pulsar-functions-python-runner \
125+
-f images/pulsar-functions-python-runner/pulsarctl.Dockerfile \
126+
--build-arg PULSAR_IMAGE="${PULSAR_IMAGE}" \
127+
--build-arg PULSAR_IMAGE_TAG="${PULSAR_IMAGE_TAG}" \
128+
--build-arg PYTHON_VERSION="${PYTHON_VERSION}" \
129+
--progress=plain
130+
tag_local_aliases "${PYTHON_RUNNER_IMAGE}" "${PYTHON_RUNNER}"
131+
tag_local_aliases "${PULSARCTL_PYTHON_RUNNER_IMAGE}" "${PULSARCTL_PYTHON_RUNNER}"
55132

56133
echo "build go runner"
57-
docker build --platform linux/amd64 -t ${GO_RUNNER} images/pulsar-functions-go-runner --progress=plain # go runner is almost the same as runner base, so we no need to given build args for go runner
58-
docker build --platform linux/amd64 -t ${PULSARCTL_GO_RUNNER} images/pulsar-functions-go-runner -f images/pulsar-functions-go-runner/pulsarctl.Dockerfile --progress=plain # go runner is almost the same as runner base, so we no need to given build args for go runner
59-
docker tag ${GO_RUNNER} "${DOCKER_REPO}"/${GO_RUNNER}:"${RUNNER_TAG}"
60-
docker tag ${PULSARCTL_GO_RUNNER} "${DOCKER_REPO}"/${PULSARCTL_GO_RUNNER}:"${RUNNER_TAG}"
134+
build_image "${GO_RUNNER_IMAGE}" images/pulsar-functions-go-runner \
135+
--build-arg BASE_IMAGE="${RUNNER_BASE_IMAGE}" \
136+
--progress=plain
137+
build_image "${PULSARCTL_GO_RUNNER_IMAGE}" images/pulsar-functions-go-runner \
138+
-f images/pulsar-functions-go-runner/pulsarctl.Dockerfile \
139+
--build-arg BASE_IMAGE="${PULSARCTL_RUNNER_BASE_IMAGE}" \
140+
--progress=plain
141+
tag_local_aliases "${GO_RUNNER_IMAGE}" "${GO_RUNNER}"
142+
tag_local_aliases "${PULSARCTL_GO_RUNNER_IMAGE}" "${PULSARCTL_GO_RUNNER}"
61143

62144
if [ "$KIND_PUSH" = true ] ; then
63145
echo "push images to kind"
64146
clusters=$(kind get clusters)
65147
echo $clusters
66148
for cluster in $clusters
67149
do
68-
kind load docker-image "${DOCKER_REPO}"/${JAVA_RUNNER}:"${RUNNER_TAG}" --name $cluster
69-
kind load docker-image "${DOCKER_REPO}"/${PULSARCTL_JAVA_RUNNER}:"${RUNNER_TAG}" --name $cluster
70-
kind load docker-image "${DOCKER_REPO}"/${PYTHON_RUNNER}:"${RUNNER_TAG}" --name $cluster
71-
kind load docker-image "${DOCKER_REPO}"/${PULSARCTL_PYTHON_RUNNER}:"${RUNNER_TAG}" --name $cluster
72-
kind load docker-image "${DOCKER_REPO}"/${GO_RUNNER}:"${RUNNER_TAG}" --name $cluster
73-
kind load docker-image "${DOCKER_REPO}"/${PULSARCTL_GO_RUNNER}:"${RUNNER_TAG}" --name $cluster
150+
kind load docker-image "${JAVA_RUNNER_IMAGE}" --name $cluster
151+
kind load docker-image "${PULSARCTL_JAVA_RUNNER_IMAGE}" --name $cluster
152+
kind load docker-image "${PYTHON_RUNNER_IMAGE}" --name $cluster
153+
kind load docker-image "${PULSARCTL_PYTHON_RUNNER_IMAGE}" --name $cluster
154+
kind load docker-image "${GO_RUNNER_IMAGE}" --name $cluster
155+
kind load docker-image "${PULSARCTL_GO_RUNNER_IMAGE}" --name $cluster
74156
done
75157
fi
76158

77-
if [ "$DOCKER_REPO" = "localhost:5000" ]; then
78-
docker push "${DOCKER_REPO}"/${JAVA_RUNNER}:"${RUNNER_TAG}"
79-
docker push "${DOCKER_REPO}"/${PULSARCTL_JAVA_RUNNER}:"${RUNNER_TAG}"
80-
docker push "${DOCKER_REPO}"/${PYTHON_RUNNER}:"${RUNNER_TAG}"
81-
docker push "${DOCKER_REPO}"/${PULSARCTL_PYTHON_RUNNER}:"${RUNNER_TAG}"
82-
docker push "${DOCKER_REPO}"/${GO_RUNNER}:"${RUNNER_TAG}"
83-
docker push "${DOCKER_REPO}"/${PULSARCTL_GO_RUNNER}:"${RUNNER_TAG}"
159+
if [[ "${PUSH}" == "true" && "${MULTI_PLATFORM}" != "true" ]]; then
160+
docker push "${RUNNER_BASE_IMAGE}"
161+
docker push "${PULSARCTL_RUNNER_BASE_IMAGE}"
162+
docker push "${JAVA_RUNNER_IMAGE}"
163+
docker push "${PULSARCTL_JAVA_RUNNER_IMAGE}"
164+
docker push "${PYTHON_RUNNER_IMAGE}"
165+
docker push "${PULSARCTL_PYTHON_RUNNER_IMAGE}"
166+
docker push "${GO_RUNNER_IMAGE}"
167+
docker push "${PULSARCTL_GO_RUNNER_IMAGE}"
84168
fi
85169
#
86170
#if [ "$CI_TEST" = true ] ; then
@@ -93,4 +177,4 @@ fi
93177
# kind load docker-image "${DOCKER_REPO}"/${PYTHON_RUNNER}:"${RUNNER_TAG}" --name $cluster
94178
# kind load docker-image "${DOCKER_REPO}"/${GO_RUNNER}:"${RUNNER_TAG}" --name $cluster
95179
# done
96-
#fi
180+
#fi

0 commit comments

Comments
 (0)